@inline-chat/hermes-agent-adapter 0.0.8 → 0.0.9

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.
@@ -5690,6 +5690,7 @@ var RpcError_Code;
5690
5690
  RpcError_Code2[RpcError_Code2["USERNAME_TAKEN"] = 16] = "USERNAME_TAKEN";
5691
5691
  RpcError_Code2[RpcError_Code2["FIRST_NAME_INVALID"] = 17] = "FIRST_NAME_INVALID";
5692
5692
  RpcError_Code2[RpcError_Code2["URL_PREVIEW_UNAVAILABLE"] = 18] = "URL_PREVIEW_UNAVAILABLE";
5693
+ RpcError_Code2[RpcError_Code2["AGENT_SESSION_MESSAGE_IMMUTABLE"] = 19] = "AGENT_SESSION_MESSAGE_IMMUTABLE";
5693
5694
  })(RpcError_Code || (RpcError_Code = {}));
5694
5695
  var SyncSkippedSequence_Reason;
5695
5696
  (function(SyncSkippedSequence_Reason2) {
@@ -5811,11 +5812,56 @@ var DialogFollowMode;
5811
5812
  DialogFollowMode2[DialogFollowMode2["FOLLOWING"] = 1] = "FOLLOWING";
5812
5813
  DialogFollowMode2[DialogFollowMode2["UNFOLLOWED"] = 2] = "UNFOLLOWED";
5813
5814
  })(DialogFollowMode || (DialogFollowMode = {}));
5815
+ var AgentSessionProvider;
5816
+ (function(AgentSessionProvider2) {
5817
+ AgentSessionProvider2[AgentSessionProvider2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
5818
+ AgentSessionProvider2[AgentSessionProvider2["CODEX"] = 1] = "CODEX";
5819
+ AgentSessionProvider2[AgentSessionProvider2["CODEX_CLOUD"] = 2] = "CODEX_CLOUD";
5820
+ AgentSessionProvider2[AgentSessionProvider2["CLAUDE"] = 3] = "CLAUDE";
5821
+ AgentSessionProvider2[AgentSessionProvider2["OPEN_CODE"] = 4] = "OPEN_CODE";
5822
+ AgentSessionProvider2[AgentSessionProvider2["AMP"] = 5] = "AMP";
5823
+ })(AgentSessionProvider || (AgentSessionProvider = {}));
5824
+ var AgentSessionMessageRole;
5825
+ (function(AgentSessionMessageRole2) {
5826
+ AgentSessionMessageRole2[AgentSessionMessageRole2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
5827
+ AgentSessionMessageRole2[AgentSessionMessageRole2["USER"] = 1] = "USER";
5828
+ AgentSessionMessageRole2[AgentSessionMessageRole2["ASSISTANT"] = 2] = "ASSISTANT";
5829
+ })(AgentSessionMessageRole || (AgentSessionMessageRole = {}));
5830
+ var AgentSessionMessageRelation;
5831
+ (function(AgentSessionMessageRelation2) {
5832
+ AgentSessionMessageRelation2[AgentSessionMessageRelation2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
5833
+ AgentSessionMessageRelation2[AgentSessionMessageRelation2["IMPORTED"] = 1] = "IMPORTED";
5834
+ AgentSessionMessageRelation2[AgentSessionMessageRelation2["LINKED"] = 2] = "LINKED";
5835
+ })(AgentSessionMessageRelation || (AgentSessionMessageRelation = {}));
5814
5836
  var MessageSendMode;
5815
5837
  (function(MessageSendMode2) {
5816
5838
  MessageSendMode2[MessageSendMode2["MODE_UNSPECIFIED"] = 0] = "MODE_UNSPECIFIED";
5817
5839
  MessageSendMode2[MessageSendMode2["MODE_SILENT"] = 1] = "MODE_SILENT";
5818
5840
  })(MessageSendMode || (MessageSendMode = {}));
5841
+ var ConnectAgentSessionState;
5842
+ (function(ConnectAgentSessionState2) {
5843
+ ConnectAgentSessionState2[ConnectAgentSessionState2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
5844
+ ConnectAgentSessionState2[ConnectAgentSessionState2["CREATED"] = 1] = "CREATED";
5845
+ ConnectAgentSessionState2[ConnectAgentSessionState2["ALREADY_CONNECTED"] = 2] = "ALREADY_CONNECTED";
5846
+ ConnectAgentSessionState2[ConnectAgentSessionState2["CONNECTED_ELSEWHERE"] = 3] = "CONNECTED_ELSEWHERE";
5847
+ })(ConnectAgentSessionState || (ConnectAgentSessionState = {}));
5848
+ var AgentSessionSyncMode;
5849
+ (function(AgentSessionSyncMode2) {
5850
+ AgentSessionSyncMode2[AgentSessionSyncMode2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
5851
+ AgentSessionSyncMode2[AgentSessionSyncMode2["HISTORY"] = 1] = "HISTORY";
5852
+ AgentSessionSyncMode2[AgentSessionSyncMode2["LIVE"] = 2] = "LIVE";
5853
+ })(AgentSessionSyncMode || (AgentSessionSyncMode = {}));
5854
+ var AgentSessionMessageSyncState;
5855
+ (function(AgentSessionMessageSyncState2) {
5856
+ AgentSessionMessageSyncState2[AgentSessionMessageSyncState2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
5857
+ AgentSessionMessageSyncState2[AgentSessionMessageSyncState2["CREATED"] = 1] = "CREATED";
5858
+ AgentSessionMessageSyncState2[AgentSessionMessageSyncState2["EDITED"] = 2] = "EDITED";
5859
+ AgentSessionMessageSyncState2[AgentSessionMessageSyncState2["LINKED"] = 3] = "LINKED";
5860
+ AgentSessionMessageSyncState2[AgentSessionMessageSyncState2["UNCHANGED"] = 4] = "UNCHANGED";
5861
+ AgentSessionMessageSyncState2[AgentSessionMessageSyncState2["STALE"] = 5] = "STALE";
5862
+ AgentSessionMessageSyncState2[AgentSessionMessageSyncState2["TOMBSTONED"] = 6] = "TOMBSTONED";
5863
+ AgentSessionMessageSyncState2[AgentSessionMessageSyncState2["CONFLICT"] = 7] = "CONFLICT";
5864
+ })(AgentSessionMessageSyncState || (AgentSessionMessageSyncState = {}));
5819
5865
  var Method;
5820
5866
  (function(Method2) {
5821
5867
  Method2[Method2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
@@ -5945,6 +5991,11 @@ var Method;
5945
5991
  Method2[Method2["UPDATE_DIALOG_FOLDER"] = 125] = "UPDATE_DIALOG_FOLDER";
5946
5992
  Method2[Method2["DELETE_DIALOG_FOLDER"] = 126] = "DELETE_DIALOG_FOLDER";
5947
5993
  Method2[Method2["GET_SPACE"] = 127] = "GET_SPACE";
5994
+ Method2[Method2["CONNECT_AGENT_SESSION"] = 128] = "CONNECT_AGENT_SESSION";
5995
+ Method2[Method2["SYNC_AGENT_SESSION_MESSAGES"] = 129] = "SYNC_AGENT_SESSION_MESSAGES";
5996
+ Method2[Method2["GET_AGENT_SESSION"] = 130] = "GET_AGENT_SESSION";
5997
+ Method2[Method2["UPDATE_BOT_AGENT"] = 131] = "UPDATE_BOT_AGENT";
5998
+ Method2[Method2["DELETE_BOT_AGENT"] = 132] = "DELETE_BOT_AGENT";
5948
5999
  })(Method || (Method = {}));
5949
6000
  var GridConnectionUnavailableReason;
5950
6001
  (function(GridConnectionUnavailableReason2) {
@@ -9496,7 +9547,8 @@ class Message$Type extends import_runtime4.MessageType {
9496
9547
  { no: 20, name: "actions", kind: "message", T: () => MessageActions },
9497
9548
  { no: 21, name: "rev", kind: "scalar", opt: true, T: 3, L: 0 },
9498
9549
  { no: 22, name: "service_message", kind: "message", T: () => MessageService },
9499
- { no: 23, name: "block_content", kind: "message", T: () => BlockContent }
9550
+ { no: 23, name: "block_content", kind: "message", T: () => BlockContent },
9551
+ { no: 24, name: "agent_session", kind: "message", T: () => AgentSessionMessageInfo }
9500
9552
  ]);
9501
9553
  }
9502
9554
  create(value) {
@@ -9587,6 +9639,9 @@ class Message$Type extends import_runtime4.MessageType {
9587
9639
  case 23:
9588
9640
  message.blockContent = BlockContent.internalBinaryRead(reader, reader.uint32(), options, message.blockContent);
9589
9641
  break;
9642
+ case 24:
9643
+ message.agentSession = AgentSessionMessageInfo.internalBinaryRead(reader, reader.uint32(), options, message.agentSession);
9644
+ break;
9590
9645
  default:
9591
9646
  let u = options.readUnknownField;
9592
9647
  if (u === "throw")
@@ -9647,6 +9702,8 @@ class Message$Type extends import_runtime4.MessageType {
9647
9702
  MessageService.internalBinaryWrite(message.serviceMessage, writer.tag(22, import_runtime.WireType.LengthDelimited).fork(), options).join();
9648
9703
  if (message.blockContent)
9649
9704
  BlockContent.internalBinaryWrite(message.blockContent, writer.tag(23, import_runtime.WireType.LengthDelimited).fork(), options).join();
9705
+ if (message.agentSession)
9706
+ AgentSessionMessageInfo.internalBinaryWrite(message.agentSession, writer.tag(24, import_runtime.WireType.LengthDelimited).fork(), options).join();
9650
9707
  let u = options.writeUnknownFields;
9651
9708
  if (u !== false)
9652
9709
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -9655,6 +9712,70 @@ class Message$Type extends import_runtime4.MessageType {
9655
9712
  }
9656
9713
  var Message = new Message$Type;
9657
9714
 
9715
+ class AgentSessionMessageInfo$Type extends import_runtime4.MessageType {
9716
+ constructor() {
9717
+ super("AgentSessionMessageInfo", [
9718
+ { no: 1, name: "agent_session_id", kind: "scalar", T: 3, L: 0 },
9719
+ { no: 2, name: "provider", kind: "enum", T: () => ["AgentSessionProvider", AgentSessionProvider, "AGENT_SESSION_PROVIDER_"] },
9720
+ { no: 3, name: "role", kind: "enum", T: () => ["AgentSessionMessageRole", AgentSessionMessageRole, "AGENT_SESSION_MESSAGE_ROLE_"] },
9721
+ { no: 4, name: "relation", kind: "enum", T: () => ["AgentSessionMessageRelation", AgentSessionMessageRelation, "AGENT_SESSION_MESSAGE_RELATION_"] }
9722
+ ]);
9723
+ }
9724
+ create(value) {
9725
+ const message = globalThis.Object.create(this.messagePrototype);
9726
+ message.agentSessionId = 0n;
9727
+ message.provider = 0;
9728
+ message.role = 0;
9729
+ message.relation = 0;
9730
+ if (value !== undefined)
9731
+ import_runtime3.reflectionMergePartial(this, message, value);
9732
+ return message;
9733
+ }
9734
+ internalBinaryRead(reader, length, options, target) {
9735
+ let message = target ?? this.create(), end = reader.pos + length;
9736
+ while (reader.pos < end) {
9737
+ let [fieldNo, wireType] = reader.tag();
9738
+ switch (fieldNo) {
9739
+ case 1:
9740
+ message.agentSessionId = reader.int64().toBigInt();
9741
+ break;
9742
+ case 2:
9743
+ message.provider = reader.int32();
9744
+ break;
9745
+ case 3:
9746
+ message.role = reader.int32();
9747
+ break;
9748
+ case 4:
9749
+ message.relation = reader.int32();
9750
+ break;
9751
+ default:
9752
+ let u = options.readUnknownField;
9753
+ if (u === "throw")
9754
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
9755
+ let d = reader.skip(wireType);
9756
+ if (u !== false)
9757
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
9758
+ }
9759
+ }
9760
+ return message;
9761
+ }
9762
+ internalBinaryWrite(message, writer, options) {
9763
+ if (message.agentSessionId !== 0n)
9764
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.agentSessionId);
9765
+ if (message.provider !== 0)
9766
+ writer.tag(2, import_runtime.WireType.Varint).int32(message.provider);
9767
+ if (message.role !== 0)
9768
+ writer.tag(3, import_runtime.WireType.Varint).int32(message.role);
9769
+ if (message.relation !== 0)
9770
+ writer.tag(4, import_runtime.WireType.Varint).int32(message.relation);
9771
+ let u = options.writeUnknownFields;
9772
+ if (u !== false)
9773
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
9774
+ return writer;
9775
+ }
9776
+ }
9777
+ var AgentSessionMessageInfo = new AgentSessionMessageInfo$Type;
9778
+
9658
9779
  class MessageFwdHeader$Type extends import_runtime4.MessageType {
9659
9780
  constructor() {
9660
9781
  super("MessageFwdHeader", [
@@ -10559,6 +10680,718 @@ class GetSpaceResult$Type extends import_runtime4.MessageType {
10559
10680
  }
10560
10681
  var GetSpaceResult = new GetSpaceResult$Type;
10561
10682
 
10683
+ class AgentSession$Type extends import_runtime4.MessageType {
10684
+ constructor() {
10685
+ super("AgentSession", [
10686
+ { no: 1, name: "id", kind: "scalar", T: 3, L: 0 },
10687
+ { no: 2, name: "peer_id", kind: "message", T: () => Peer },
10688
+ { no: 3, name: "bot_user_id", kind: "scalar", T: 3, L: 0 },
10689
+ { no: 4, name: "provider", kind: "enum", T: () => ["AgentSessionProvider", AgentSessionProvider, "AGENT_SESSION_PROVIDER_"] },
10690
+ { no: 5, name: "status_message_id", kind: "scalar", opt: true, T: 3, L: 0 }
10691
+ ]);
10692
+ }
10693
+ create(value) {
10694
+ const message = globalThis.Object.create(this.messagePrototype);
10695
+ message.id = 0n;
10696
+ message.botUserId = 0n;
10697
+ message.provider = 0;
10698
+ if (value !== undefined)
10699
+ import_runtime3.reflectionMergePartial(this, message, value);
10700
+ return message;
10701
+ }
10702
+ internalBinaryRead(reader, length, options, target) {
10703
+ let message = target ?? this.create(), end = reader.pos + length;
10704
+ while (reader.pos < end) {
10705
+ let [fieldNo, wireType] = reader.tag();
10706
+ switch (fieldNo) {
10707
+ case 1:
10708
+ message.id = reader.int64().toBigInt();
10709
+ break;
10710
+ case 2:
10711
+ message.peerId = Peer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
10712
+ break;
10713
+ case 3:
10714
+ message.botUserId = reader.int64().toBigInt();
10715
+ break;
10716
+ case 4:
10717
+ message.provider = reader.int32();
10718
+ break;
10719
+ case 5:
10720
+ message.statusMessageId = reader.int64().toBigInt();
10721
+ break;
10722
+ default:
10723
+ let u = options.readUnknownField;
10724
+ if (u === "throw")
10725
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
10726
+ let d = reader.skip(wireType);
10727
+ if (u !== false)
10728
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
10729
+ }
10730
+ }
10731
+ return message;
10732
+ }
10733
+ internalBinaryWrite(message, writer, options) {
10734
+ if (message.id !== 0n)
10735
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.id);
10736
+ if (message.peerId)
10737
+ Peer.internalBinaryWrite(message.peerId, writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
10738
+ if (message.botUserId !== 0n)
10739
+ writer.tag(3, import_runtime.WireType.Varint).int64(message.botUserId);
10740
+ if (message.provider !== 0)
10741
+ writer.tag(4, import_runtime.WireType.Varint).int32(message.provider);
10742
+ if (message.statusMessageId !== undefined)
10743
+ writer.tag(5, import_runtime.WireType.Varint).int64(message.statusMessageId);
10744
+ let u = options.writeUnknownFields;
10745
+ if (u !== false)
10746
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
10747
+ return writer;
10748
+ }
10749
+ }
10750
+ var AgentSession = new AgentSession$Type;
10751
+
10752
+ class ConnectAgentSessionInput$Type extends import_runtime4.MessageType {
10753
+ constructor() {
10754
+ super("ConnectAgentSessionInput", [
10755
+ { no: 1, name: "peer_id", kind: "message", T: () => InputPeer },
10756
+ { no: 2, name: "bot_user_id", kind: "scalar", T: 3, L: 0 },
10757
+ { no: 3, name: "provider", kind: "enum", T: () => ["AgentSessionProvider", AgentSessionProvider, "AGENT_SESSION_PROVIDER_"] },
10758
+ { no: 4, name: "instance_ref", kind: "scalar", T: 9 },
10759
+ { no: 5, name: "session_ref", kind: "scalar", T: 9 },
10760
+ { no: 6, name: "project_ref", kind: "scalar", opt: true, T: 9 },
10761
+ { no: 7, name: "status_message_id", kind: "scalar", opt: true, T: 3, L: 0 }
10762
+ ]);
10763
+ }
10764
+ create(value) {
10765
+ const message = globalThis.Object.create(this.messagePrototype);
10766
+ message.botUserId = 0n;
10767
+ message.provider = 0;
10768
+ message.instanceRef = "";
10769
+ message.sessionRef = "";
10770
+ if (value !== undefined)
10771
+ import_runtime3.reflectionMergePartial(this, message, value);
10772
+ return message;
10773
+ }
10774
+ internalBinaryRead(reader, length, options, target) {
10775
+ let message = target ?? this.create(), end = reader.pos + length;
10776
+ while (reader.pos < end) {
10777
+ let [fieldNo, wireType] = reader.tag();
10778
+ switch (fieldNo) {
10779
+ case 1:
10780
+ message.peerId = InputPeer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
10781
+ break;
10782
+ case 2:
10783
+ message.botUserId = reader.int64().toBigInt();
10784
+ break;
10785
+ case 3:
10786
+ message.provider = reader.int32();
10787
+ break;
10788
+ case 4:
10789
+ message.instanceRef = reader.string();
10790
+ break;
10791
+ case 5:
10792
+ message.sessionRef = reader.string();
10793
+ break;
10794
+ case 6:
10795
+ message.projectRef = reader.string();
10796
+ break;
10797
+ case 7:
10798
+ message.statusMessageId = reader.int64().toBigInt();
10799
+ break;
10800
+ default:
10801
+ let u = options.readUnknownField;
10802
+ if (u === "throw")
10803
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
10804
+ let d = reader.skip(wireType);
10805
+ if (u !== false)
10806
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
10807
+ }
10808
+ }
10809
+ return message;
10810
+ }
10811
+ internalBinaryWrite(message, writer, options) {
10812
+ if (message.peerId)
10813
+ InputPeer.internalBinaryWrite(message.peerId, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
10814
+ if (message.botUserId !== 0n)
10815
+ writer.tag(2, import_runtime.WireType.Varint).int64(message.botUserId);
10816
+ if (message.provider !== 0)
10817
+ writer.tag(3, import_runtime.WireType.Varint).int32(message.provider);
10818
+ if (message.instanceRef !== "")
10819
+ writer.tag(4, import_runtime.WireType.LengthDelimited).string(message.instanceRef);
10820
+ if (message.sessionRef !== "")
10821
+ writer.tag(5, import_runtime.WireType.LengthDelimited).string(message.sessionRef);
10822
+ if (message.projectRef !== undefined)
10823
+ writer.tag(6, import_runtime.WireType.LengthDelimited).string(message.projectRef);
10824
+ if (message.statusMessageId !== undefined)
10825
+ writer.tag(7, import_runtime.WireType.Varint).int64(message.statusMessageId);
10826
+ let u = options.writeUnknownFields;
10827
+ if (u !== false)
10828
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
10829
+ return writer;
10830
+ }
10831
+ }
10832
+ var ConnectAgentSessionInput = new ConnectAgentSessionInput$Type;
10833
+
10834
+ class ConnectAgentSessionResult$Type extends import_runtime4.MessageType {
10835
+ constructor() {
10836
+ super("ConnectAgentSessionResult", [
10837
+ { no: 1, name: "agent_session", kind: "message", T: () => AgentSession },
10838
+ { no: 2, name: "state", kind: "enum", T: () => ["ConnectAgentSessionState", ConnectAgentSessionState, "CONNECT_AGENT_SESSION_STATE_"] }
10839
+ ]);
10840
+ }
10841
+ create(value) {
10842
+ const message = globalThis.Object.create(this.messagePrototype);
10843
+ message.state = 0;
10844
+ if (value !== undefined)
10845
+ import_runtime3.reflectionMergePartial(this, message, value);
10846
+ return message;
10847
+ }
10848
+ internalBinaryRead(reader, length, options, target) {
10849
+ let message = target ?? this.create(), end = reader.pos + length;
10850
+ while (reader.pos < end) {
10851
+ let [fieldNo, wireType] = reader.tag();
10852
+ switch (fieldNo) {
10853
+ case 1:
10854
+ message.agentSession = AgentSession.internalBinaryRead(reader, reader.uint32(), options, message.agentSession);
10855
+ break;
10856
+ case 2:
10857
+ message.state = reader.int32();
10858
+ break;
10859
+ default:
10860
+ let u = options.readUnknownField;
10861
+ if (u === "throw")
10862
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
10863
+ let d = reader.skip(wireType);
10864
+ if (u !== false)
10865
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
10866
+ }
10867
+ }
10868
+ return message;
10869
+ }
10870
+ internalBinaryWrite(message, writer, options) {
10871
+ if (message.agentSession)
10872
+ AgentSession.internalBinaryWrite(message.agentSession, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
10873
+ if (message.state !== 0)
10874
+ writer.tag(2, import_runtime.WireType.Varint).int32(message.state);
10875
+ let u = options.writeUnknownFields;
10876
+ if (u !== false)
10877
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
10878
+ return writer;
10879
+ }
10880
+ }
10881
+ var ConnectAgentSessionResult = new ConnectAgentSessionResult$Type;
10882
+
10883
+ class AgentSessionConnection$Type extends import_runtime4.MessageType {
10884
+ constructor() {
10885
+ super("AgentSessionConnection", [
10886
+ { no: 1, name: "agent_session", kind: "message", T: () => AgentSession },
10887
+ { no: 2, name: "instance_ref", kind: "scalar", T: 9 },
10888
+ { no: 3, name: "session_ref", kind: "scalar", T: 9 },
10889
+ { no: 4, name: "project_ref", kind: "scalar", opt: true, T: 9 }
10890
+ ]);
10891
+ }
10892
+ create(value) {
10893
+ const message = globalThis.Object.create(this.messagePrototype);
10894
+ message.instanceRef = "";
10895
+ message.sessionRef = "";
10896
+ if (value !== undefined)
10897
+ import_runtime3.reflectionMergePartial(this, message, value);
10898
+ return message;
10899
+ }
10900
+ internalBinaryRead(reader, length, options, target) {
10901
+ let message = target ?? this.create(), end = reader.pos + length;
10902
+ while (reader.pos < end) {
10903
+ let [fieldNo, wireType] = reader.tag();
10904
+ switch (fieldNo) {
10905
+ case 1:
10906
+ message.agentSession = AgentSession.internalBinaryRead(reader, reader.uint32(), options, message.agentSession);
10907
+ break;
10908
+ case 2:
10909
+ message.instanceRef = reader.string();
10910
+ break;
10911
+ case 3:
10912
+ message.sessionRef = reader.string();
10913
+ break;
10914
+ case 4:
10915
+ message.projectRef = reader.string();
10916
+ break;
10917
+ default:
10918
+ let u = options.readUnknownField;
10919
+ if (u === "throw")
10920
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
10921
+ let d = reader.skip(wireType);
10922
+ if (u !== false)
10923
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
10924
+ }
10925
+ }
10926
+ return message;
10927
+ }
10928
+ internalBinaryWrite(message, writer, options) {
10929
+ if (message.agentSession)
10930
+ AgentSession.internalBinaryWrite(message.agentSession, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
10931
+ if (message.instanceRef !== "")
10932
+ writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.instanceRef);
10933
+ if (message.sessionRef !== "")
10934
+ writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.sessionRef);
10935
+ if (message.projectRef !== undefined)
10936
+ writer.tag(4, import_runtime.WireType.LengthDelimited).string(message.projectRef);
10937
+ let u = options.writeUnknownFields;
10938
+ if (u !== false)
10939
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
10940
+ return writer;
10941
+ }
10942
+ }
10943
+ var AgentSessionConnection = new AgentSessionConnection$Type;
10944
+
10945
+ class GetAgentSessionInput$Type extends import_runtime4.MessageType {
10946
+ constructor() {
10947
+ super("GetAgentSessionInput", [
10948
+ { no: 1, name: "peer_id", kind: "message", T: () => InputPeer },
10949
+ { no: 2, name: "bot_user_id", kind: "scalar", T: 3, L: 0 }
10950
+ ]);
10951
+ }
10952
+ create(value) {
10953
+ const message = globalThis.Object.create(this.messagePrototype);
10954
+ message.botUserId = 0n;
10955
+ if (value !== undefined)
10956
+ import_runtime3.reflectionMergePartial(this, message, value);
10957
+ return message;
10958
+ }
10959
+ internalBinaryRead(reader, length, options, target) {
10960
+ let message = target ?? this.create(), end = reader.pos + length;
10961
+ while (reader.pos < end) {
10962
+ let [fieldNo, wireType] = reader.tag();
10963
+ switch (fieldNo) {
10964
+ case 1:
10965
+ message.peerId = InputPeer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
10966
+ break;
10967
+ case 2:
10968
+ message.botUserId = reader.int64().toBigInt();
10969
+ break;
10970
+ default:
10971
+ let u = options.readUnknownField;
10972
+ if (u === "throw")
10973
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
10974
+ let d = reader.skip(wireType);
10975
+ if (u !== false)
10976
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
10977
+ }
10978
+ }
10979
+ return message;
10980
+ }
10981
+ internalBinaryWrite(message, writer, options) {
10982
+ if (message.peerId)
10983
+ InputPeer.internalBinaryWrite(message.peerId, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
10984
+ if (message.botUserId !== 0n)
10985
+ writer.tag(2, import_runtime.WireType.Varint).int64(message.botUserId);
10986
+ let u = options.writeUnknownFields;
10987
+ if (u !== false)
10988
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
10989
+ return writer;
10990
+ }
10991
+ }
10992
+ var GetAgentSessionInput = new GetAgentSessionInput$Type;
10993
+
10994
+ class GetAgentSessionResult$Type extends import_runtime4.MessageType {
10995
+ constructor() {
10996
+ super("GetAgentSessionResult", [
10997
+ { no: 1, name: "connection", kind: "message", T: () => AgentSessionConnection }
10998
+ ]);
10999
+ }
11000
+ create(value) {
11001
+ const message = globalThis.Object.create(this.messagePrototype);
11002
+ if (value !== undefined)
11003
+ import_runtime3.reflectionMergePartial(this, message, value);
11004
+ return message;
11005
+ }
11006
+ internalBinaryRead(reader, length, options, target) {
11007
+ let message = target ?? this.create(), end = reader.pos + length;
11008
+ while (reader.pos < end) {
11009
+ let [fieldNo, wireType] = reader.tag();
11010
+ switch (fieldNo) {
11011
+ case 1:
11012
+ message.connection = AgentSessionConnection.internalBinaryRead(reader, reader.uint32(), options, message.connection);
11013
+ break;
11014
+ default:
11015
+ let u = options.readUnknownField;
11016
+ if (u === "throw")
11017
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
11018
+ let d = reader.skip(wireType);
11019
+ if (u !== false)
11020
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
11021
+ }
11022
+ }
11023
+ return message;
11024
+ }
11025
+ internalBinaryWrite(message, writer, options) {
11026
+ if (message.connection)
11027
+ AgentSessionConnection.internalBinaryWrite(message.connection, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
11028
+ let u = options.writeUnknownFields;
11029
+ if (u !== false)
11030
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
11031
+ return writer;
11032
+ }
11033
+ }
11034
+ var GetAgentSessionResult = new GetAgentSessionResult$Type;
11035
+
11036
+ class AgentSessionMessageUpsert$Type extends import_runtime4.MessageType {
11037
+ constructor() {
11038
+ super("AgentSessionMessageUpsert", [
11039
+ { no: 1, name: "text", kind: "scalar", T: 9 },
11040
+ { no: 2, name: "entities", kind: "message", T: () => MessageEntities },
11041
+ { no: 3, name: "assistant_random_id", kind: "scalar", opt: true, T: 3, L: 0 }
11042
+ ]);
11043
+ }
11044
+ create(value) {
11045
+ const message = globalThis.Object.create(this.messagePrototype);
11046
+ message.text = "";
11047
+ if (value !== undefined)
11048
+ import_runtime3.reflectionMergePartial(this, message, value);
11049
+ return message;
11050
+ }
11051
+ internalBinaryRead(reader, length, options, target) {
11052
+ let message = target ?? this.create(), end = reader.pos + length;
11053
+ while (reader.pos < end) {
11054
+ let [fieldNo, wireType] = reader.tag();
11055
+ switch (fieldNo) {
11056
+ case 1:
11057
+ message.text = reader.string();
11058
+ break;
11059
+ case 2:
11060
+ message.entities = MessageEntities.internalBinaryRead(reader, reader.uint32(), options, message.entities);
11061
+ break;
11062
+ case 3:
11063
+ message.assistantRandomId = reader.int64().toBigInt();
11064
+ break;
11065
+ default:
11066
+ let u = options.readUnknownField;
11067
+ if (u === "throw")
11068
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
11069
+ let d = reader.skip(wireType);
11070
+ if (u !== false)
11071
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
11072
+ }
11073
+ }
11074
+ return message;
11075
+ }
11076
+ internalBinaryWrite(message, writer, options) {
11077
+ if (message.text !== "")
11078
+ writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.text);
11079
+ if (message.entities)
11080
+ MessageEntities.internalBinaryWrite(message.entities, writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
11081
+ if (message.assistantRandomId !== undefined)
11082
+ writer.tag(3, import_runtime.WireType.Varint).int64(message.assistantRandomId);
11083
+ let u = options.writeUnknownFields;
11084
+ if (u !== false)
11085
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
11086
+ return writer;
11087
+ }
11088
+ }
11089
+ var AgentSessionMessageUpsert = new AgentSessionMessageUpsert$Type;
11090
+
11091
+ class AgentSessionMessageLink$Type extends import_runtime4.MessageType {
11092
+ constructor() {
11093
+ super("AgentSessionMessageLink", [
11094
+ { no: 1, name: "message_id", kind: "scalar", T: 3, L: 0 }
11095
+ ]);
11096
+ }
11097
+ create(value) {
11098
+ const message = globalThis.Object.create(this.messagePrototype);
11099
+ message.messageId = 0n;
11100
+ if (value !== undefined)
11101
+ import_runtime3.reflectionMergePartial(this, message, value);
11102
+ return message;
11103
+ }
11104
+ internalBinaryRead(reader, length, options, target) {
11105
+ let message = target ?? this.create(), end = reader.pos + length;
11106
+ while (reader.pos < end) {
11107
+ let [fieldNo, wireType] = reader.tag();
11108
+ switch (fieldNo) {
11109
+ case 1:
11110
+ message.messageId = reader.int64().toBigInt();
11111
+ break;
11112
+ default:
11113
+ let u = options.readUnknownField;
11114
+ if (u === "throw")
11115
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
11116
+ let d = reader.skip(wireType);
11117
+ if (u !== false)
11118
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
11119
+ }
11120
+ }
11121
+ return message;
11122
+ }
11123
+ internalBinaryWrite(message, writer, options) {
11124
+ if (message.messageId !== 0n)
11125
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.messageId);
11126
+ let u = options.writeUnknownFields;
11127
+ if (u !== false)
11128
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
11129
+ return writer;
11130
+ }
11131
+ }
11132
+ var AgentSessionMessageLink = new AgentSessionMessageLink$Type;
11133
+
11134
+ class AgentSessionMessageSync$Type extends import_runtime4.MessageType {
11135
+ constructor() {
11136
+ super("AgentSessionMessageSync", [
11137
+ { no: 1, name: "role", kind: "enum", T: () => ["AgentSessionMessageRole", AgentSessionMessageRole, "AGENT_SESSION_MESSAGE_ROLE_"] },
11138
+ { no: 2, name: "item_ref", kind: "scalar", opt: true, T: 9 },
11139
+ { no: 3, name: "correlation_ref", kind: "scalar", opt: true, T: 9 },
11140
+ { no: 4, name: "source_date", kind: "scalar", opt: true, T: 3, L: 0 },
11141
+ { no: 5, name: "revision_ref", kind: "scalar", opt: true, T: 9 },
11142
+ { no: 6, name: "base_revision_ref", kind: "scalar", opt: true, T: 9 },
11143
+ { no: 7, name: "complete", kind: "scalar", T: 8 },
11144
+ { no: 8, name: "upsert", kind: "message", oneof: "operation", T: () => AgentSessionMessageUpsert },
11145
+ { no: 9, name: "link", kind: "message", oneof: "operation", T: () => AgentSessionMessageLink }
11146
+ ]);
11147
+ }
11148
+ create(value) {
11149
+ const message = globalThis.Object.create(this.messagePrototype);
11150
+ message.role = 0;
11151
+ message.complete = false;
11152
+ message.operation = { oneofKind: undefined };
11153
+ if (value !== undefined)
11154
+ import_runtime3.reflectionMergePartial(this, message, value);
11155
+ return message;
11156
+ }
11157
+ internalBinaryRead(reader, length, options, target) {
11158
+ let message = target ?? this.create(), end = reader.pos + length;
11159
+ while (reader.pos < end) {
11160
+ let [fieldNo, wireType] = reader.tag();
11161
+ switch (fieldNo) {
11162
+ case 1:
11163
+ message.role = reader.int32();
11164
+ break;
11165
+ case 2:
11166
+ message.itemRef = reader.string();
11167
+ break;
11168
+ case 3:
11169
+ message.correlationRef = reader.string();
11170
+ break;
11171
+ case 4:
11172
+ message.sourceDate = reader.int64().toBigInt();
11173
+ break;
11174
+ case 5:
11175
+ message.revisionRef = reader.string();
11176
+ break;
11177
+ case 6:
11178
+ message.baseRevisionRef = reader.string();
11179
+ break;
11180
+ case 7:
11181
+ message.complete = reader.bool();
11182
+ break;
11183
+ case 8:
11184
+ message.operation = {
11185
+ oneofKind: "upsert",
11186
+ upsert: AgentSessionMessageUpsert.internalBinaryRead(reader, reader.uint32(), options, message.operation.upsert)
11187
+ };
11188
+ break;
11189
+ case 9:
11190
+ message.operation = {
11191
+ oneofKind: "link",
11192
+ link: AgentSessionMessageLink.internalBinaryRead(reader, reader.uint32(), options, message.operation.link)
11193
+ };
11194
+ break;
11195
+ default:
11196
+ let u = options.readUnknownField;
11197
+ if (u === "throw")
11198
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
11199
+ let d = reader.skip(wireType);
11200
+ if (u !== false)
11201
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
11202
+ }
11203
+ }
11204
+ return message;
11205
+ }
11206
+ internalBinaryWrite(message, writer, options) {
11207
+ if (message.role !== 0)
11208
+ writer.tag(1, import_runtime.WireType.Varint).int32(message.role);
11209
+ if (message.itemRef !== undefined)
11210
+ writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.itemRef);
11211
+ if (message.correlationRef !== undefined)
11212
+ writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.correlationRef);
11213
+ if (message.sourceDate !== undefined)
11214
+ writer.tag(4, import_runtime.WireType.Varint).int64(message.sourceDate);
11215
+ if (message.revisionRef !== undefined)
11216
+ writer.tag(5, import_runtime.WireType.LengthDelimited).string(message.revisionRef);
11217
+ if (message.baseRevisionRef !== undefined)
11218
+ writer.tag(6, import_runtime.WireType.LengthDelimited).string(message.baseRevisionRef);
11219
+ if (message.complete !== false)
11220
+ writer.tag(7, import_runtime.WireType.Varint).bool(message.complete);
11221
+ if (message.operation.oneofKind === "upsert")
11222
+ AgentSessionMessageUpsert.internalBinaryWrite(message.operation.upsert, writer.tag(8, import_runtime.WireType.LengthDelimited).fork(), options).join();
11223
+ if (message.operation.oneofKind === "link")
11224
+ AgentSessionMessageLink.internalBinaryWrite(message.operation.link, writer.tag(9, import_runtime.WireType.LengthDelimited).fork(), options).join();
11225
+ let u = options.writeUnknownFields;
11226
+ if (u !== false)
11227
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
11228
+ return writer;
11229
+ }
11230
+ }
11231
+ var AgentSessionMessageSync = new AgentSessionMessageSync$Type;
11232
+
11233
+ class SyncAgentSessionMessagesInput$Type extends import_runtime4.MessageType {
11234
+ constructor() {
11235
+ super("SyncAgentSessionMessagesInput", [
11236
+ { no: 1, name: "agent_session_id", kind: "scalar", T: 3, L: 0 },
11237
+ { no: 2, name: "mode", kind: "enum", T: () => ["AgentSessionSyncMode", AgentSessionSyncMode, "AGENT_SESSION_SYNC_MODE_"] },
11238
+ { no: 3, name: "messages", kind: "message", repeat: 1, T: () => AgentSessionMessageSync }
11239
+ ]);
11240
+ }
11241
+ create(value) {
11242
+ const message = globalThis.Object.create(this.messagePrototype);
11243
+ message.agentSessionId = 0n;
11244
+ message.mode = 0;
11245
+ message.messages = [];
11246
+ if (value !== undefined)
11247
+ import_runtime3.reflectionMergePartial(this, message, value);
11248
+ return message;
11249
+ }
11250
+ internalBinaryRead(reader, length, options, target) {
11251
+ let message = target ?? this.create(), end = reader.pos + length;
11252
+ while (reader.pos < end) {
11253
+ let [fieldNo, wireType] = reader.tag();
11254
+ switch (fieldNo) {
11255
+ case 1:
11256
+ message.agentSessionId = reader.int64().toBigInt();
11257
+ break;
11258
+ case 2:
11259
+ message.mode = reader.int32();
11260
+ break;
11261
+ case 3:
11262
+ message.messages.push(AgentSessionMessageSync.internalBinaryRead(reader, reader.uint32(), options));
11263
+ break;
11264
+ default:
11265
+ let u = options.readUnknownField;
11266
+ if (u === "throw")
11267
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
11268
+ let d = reader.skip(wireType);
11269
+ if (u !== false)
11270
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
11271
+ }
11272
+ }
11273
+ return message;
11274
+ }
11275
+ internalBinaryWrite(message, writer, options) {
11276
+ if (message.agentSessionId !== 0n)
11277
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.agentSessionId);
11278
+ if (message.mode !== 0)
11279
+ writer.tag(2, import_runtime.WireType.Varint).int32(message.mode);
11280
+ for (let i = 0;i < message.messages.length; i++)
11281
+ AgentSessionMessageSync.internalBinaryWrite(message.messages[i], writer.tag(3, import_runtime.WireType.LengthDelimited).fork(), options).join();
11282
+ let u = options.writeUnknownFields;
11283
+ if (u !== false)
11284
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
11285
+ return writer;
11286
+ }
11287
+ }
11288
+ var SyncAgentSessionMessagesInput = new SyncAgentSessionMessagesInput$Type;
11289
+
11290
+ class AgentSessionMessageSyncResult$Type extends import_runtime4.MessageType {
11291
+ constructor() {
11292
+ super("AgentSessionMessageSyncResult", [
11293
+ { no: 1, name: "index", kind: "scalar", T: 5 },
11294
+ { no: 2, name: "state", kind: "enum", T: () => ["AgentSessionMessageSyncState", AgentSessionMessageSyncState, "AGENT_SESSION_MESSAGE_SYNC_STATE_"] },
11295
+ { no: 3, name: "message_id", kind: "scalar", opt: true, T: 3, L: 0 },
11296
+ { no: 4, name: "current_revision_ref", kind: "scalar", opt: true, T: 9 }
11297
+ ]);
11298
+ }
11299
+ create(value) {
11300
+ const message = globalThis.Object.create(this.messagePrototype);
11301
+ message.index = 0;
11302
+ message.state = 0;
11303
+ if (value !== undefined)
11304
+ import_runtime3.reflectionMergePartial(this, message, value);
11305
+ return message;
11306
+ }
11307
+ internalBinaryRead(reader, length, options, target) {
11308
+ let message = target ?? this.create(), end = reader.pos + length;
11309
+ while (reader.pos < end) {
11310
+ let [fieldNo, wireType] = reader.tag();
11311
+ switch (fieldNo) {
11312
+ case 1:
11313
+ message.index = reader.int32();
11314
+ break;
11315
+ case 2:
11316
+ message.state = reader.int32();
11317
+ break;
11318
+ case 3:
11319
+ message.messageId = reader.int64().toBigInt();
11320
+ break;
11321
+ case 4:
11322
+ message.currentRevisionRef = reader.string();
11323
+ break;
11324
+ default:
11325
+ let u = options.readUnknownField;
11326
+ if (u === "throw")
11327
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
11328
+ let d = reader.skip(wireType);
11329
+ if (u !== false)
11330
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
11331
+ }
11332
+ }
11333
+ return message;
11334
+ }
11335
+ internalBinaryWrite(message, writer, options) {
11336
+ if (message.index !== 0)
11337
+ writer.tag(1, import_runtime.WireType.Varint).int32(message.index);
11338
+ if (message.state !== 0)
11339
+ writer.tag(2, import_runtime.WireType.Varint).int32(message.state);
11340
+ if (message.messageId !== undefined)
11341
+ writer.tag(3, import_runtime.WireType.Varint).int64(message.messageId);
11342
+ if (message.currentRevisionRef !== undefined)
11343
+ writer.tag(4, import_runtime.WireType.LengthDelimited).string(message.currentRevisionRef);
11344
+ let u = options.writeUnknownFields;
11345
+ if (u !== false)
11346
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
11347
+ return writer;
11348
+ }
11349
+ }
11350
+ var AgentSessionMessageSyncResult = new AgentSessionMessageSyncResult$Type;
11351
+
11352
+ class SyncAgentSessionMessagesResult$Type extends import_runtime4.MessageType {
11353
+ constructor() {
11354
+ super("SyncAgentSessionMessagesResult", [
11355
+ { no: 1, name: "messages", kind: "message", repeat: 1, T: () => AgentSessionMessageSyncResult }
11356
+ ]);
11357
+ }
11358
+ create(value) {
11359
+ const message = globalThis.Object.create(this.messagePrototype);
11360
+ message.messages = [];
11361
+ if (value !== undefined)
11362
+ import_runtime3.reflectionMergePartial(this, message, value);
11363
+ return message;
11364
+ }
11365
+ internalBinaryRead(reader, length, options, target) {
11366
+ let message = target ?? this.create(), end = reader.pos + length;
11367
+ while (reader.pos < end) {
11368
+ let [fieldNo, wireType] = reader.tag();
11369
+ switch (fieldNo) {
11370
+ case 1:
11371
+ message.messages.push(AgentSessionMessageSyncResult.internalBinaryRead(reader, reader.uint32(), options));
11372
+ break;
11373
+ default:
11374
+ let u = options.readUnknownField;
11375
+ if (u === "throw")
11376
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
11377
+ let d = reader.skip(wireType);
11378
+ if (u !== false)
11379
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
11380
+ }
11381
+ }
11382
+ return message;
11383
+ }
11384
+ internalBinaryWrite(message, writer, options) {
11385
+ for (let i = 0;i < message.messages.length; i++)
11386
+ AgentSessionMessageSyncResult.internalBinaryWrite(message.messages[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
11387
+ let u = options.writeUnknownFields;
11388
+ if (u !== false)
11389
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
11390
+ return writer;
11391
+ }
11392
+ }
11393
+ var SyncAgentSessionMessagesResult = new SyncAgentSessionMessagesResult$Type;
11394
+
10562
11395
  class JoinPublicSpaceInput$Type extends import_runtime4.MessageType {
10563
11396
  constructor() {
10564
11397
  super("JoinPublicSpaceInput", [
@@ -12431,7 +13264,12 @@ class RpcCall$Type extends import_runtime4.MessageType {
12431
13264
  { no: 125, name: "createDialogFolder", kind: "message", oneof: "input", T: () => CreateDialogFolderInput },
12432
13265
  { no: 126, name: "updateDialogFolder", kind: "message", oneof: "input", T: () => UpdateDialogFolderInput },
12433
13266
  { no: 127, name: "deleteDialogFolder", kind: "message", oneof: "input", T: () => DeleteDialogFolderInput },
12434
- { no: 128, name: "getSpace", kind: "message", oneof: "input", T: () => GetSpaceInput }
13267
+ { no: 128, name: "getSpace", kind: "message", oneof: "input", T: () => GetSpaceInput },
13268
+ { no: 129, name: "connectAgentSession", kind: "message", oneof: "input", T: () => ConnectAgentSessionInput },
13269
+ { no: 130, name: "syncAgentSessionMessages", kind: "message", oneof: "input", T: () => SyncAgentSessionMessagesInput },
13270
+ { no: 131, name: "getAgentSession", kind: "message", oneof: "input", T: () => GetAgentSessionInput },
13271
+ { no: 132, name: "updateBotAgent", kind: "message", oneof: "input", T: () => UpdateBotAgentInput },
13272
+ { no: 133, name: "deleteBotAgent", kind: "message", oneof: "input", T: () => DeleteBotAgentInput }
12435
13273
  ]);
12436
13274
  }
12437
13275
  create(value) {
@@ -13206,6 +14044,36 @@ class RpcCall$Type extends import_runtime4.MessageType {
13206
14044
  getSpace: GetSpaceInput.internalBinaryRead(reader, reader.uint32(), options, message.input.getSpace)
13207
14045
  };
13208
14046
  break;
14047
+ case 129:
14048
+ message.input = {
14049
+ oneofKind: "connectAgentSession",
14050
+ connectAgentSession: ConnectAgentSessionInput.internalBinaryRead(reader, reader.uint32(), options, message.input.connectAgentSession)
14051
+ };
14052
+ break;
14053
+ case 130:
14054
+ message.input = {
14055
+ oneofKind: "syncAgentSessionMessages",
14056
+ syncAgentSessionMessages: SyncAgentSessionMessagesInput.internalBinaryRead(reader, reader.uint32(), options, message.input.syncAgentSessionMessages)
14057
+ };
14058
+ break;
14059
+ case 131:
14060
+ message.input = {
14061
+ oneofKind: "getAgentSession",
14062
+ getAgentSession: GetAgentSessionInput.internalBinaryRead(reader, reader.uint32(), options, message.input.getAgentSession)
14063
+ };
14064
+ break;
14065
+ case 132:
14066
+ message.input = {
14067
+ oneofKind: "updateBotAgent",
14068
+ updateBotAgent: UpdateBotAgentInput.internalBinaryRead(reader, reader.uint32(), options, message.input.updateBotAgent)
14069
+ };
14070
+ break;
14071
+ case 133:
14072
+ message.input = {
14073
+ oneofKind: "deleteBotAgent",
14074
+ deleteBotAgent: DeleteBotAgentInput.internalBinaryRead(reader, reader.uint32(), options, message.input.deleteBotAgent)
14075
+ };
14076
+ break;
13209
14077
  default:
13210
14078
  let u = options.readUnknownField;
13211
14079
  if (u === "throw")
@@ -13472,6 +14340,16 @@ class RpcCall$Type extends import_runtime4.MessageType {
13472
14340
  DeleteDialogFolderInput.internalBinaryWrite(message.input.deleteDialogFolder, writer.tag(127, import_runtime.WireType.LengthDelimited).fork(), options).join();
13473
14341
  if (message.input.oneofKind === "getSpace")
13474
14342
  GetSpaceInput.internalBinaryWrite(message.input.getSpace, writer.tag(128, import_runtime.WireType.LengthDelimited).fork(), options).join();
14343
+ if (message.input.oneofKind === "connectAgentSession")
14344
+ ConnectAgentSessionInput.internalBinaryWrite(message.input.connectAgentSession, writer.tag(129, import_runtime.WireType.LengthDelimited).fork(), options).join();
14345
+ if (message.input.oneofKind === "syncAgentSessionMessages")
14346
+ SyncAgentSessionMessagesInput.internalBinaryWrite(message.input.syncAgentSessionMessages, writer.tag(130, import_runtime.WireType.LengthDelimited).fork(), options).join();
14347
+ if (message.input.oneofKind === "getAgentSession")
14348
+ GetAgentSessionInput.internalBinaryWrite(message.input.getAgentSession, writer.tag(131, import_runtime.WireType.LengthDelimited).fork(), options).join();
14349
+ if (message.input.oneofKind === "updateBotAgent")
14350
+ UpdateBotAgentInput.internalBinaryWrite(message.input.updateBotAgent, writer.tag(132, import_runtime.WireType.LengthDelimited).fork(), options).join();
14351
+ if (message.input.oneofKind === "deleteBotAgent")
14352
+ DeleteBotAgentInput.internalBinaryWrite(message.input.deleteBotAgent, writer.tag(133, import_runtime.WireType.LengthDelimited).fork(), options).join();
13475
14353
  let u = options.writeUnknownFields;
13476
14354
  if (u !== false)
13477
14355
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -13609,7 +14487,12 @@ class RpcResult$Type extends import_runtime4.MessageType {
13609
14487
  { no: 125, name: "createDialogFolder", kind: "message", oneof: "result", T: () => CreateDialogFolderResult },
13610
14488
  { no: 126, name: "updateDialogFolder", kind: "message", oneof: "result", T: () => UpdateDialogFolderResult },
13611
14489
  { no: 127, name: "deleteDialogFolder", kind: "message", oneof: "result", T: () => DeleteDialogFolderResult },
13612
- { no: 128, name: "getSpace", kind: "message", oneof: "result", T: () => GetSpaceResult }
14490
+ { no: 128, name: "getSpace", kind: "message", oneof: "result", T: () => GetSpaceResult },
14491
+ { no: 129, name: "connectAgentSession", kind: "message", oneof: "result", T: () => ConnectAgentSessionResult },
14492
+ { no: 130, name: "syncAgentSessionMessages", kind: "message", oneof: "result", T: () => SyncAgentSessionMessagesResult },
14493
+ { no: 131, name: "getAgentSession", kind: "message", oneof: "result", T: () => GetAgentSessionResult },
14494
+ { no: 132, name: "updateBotAgent", kind: "message", oneof: "result", T: () => UpdateBotAgentResult },
14495
+ { no: 133, name: "deleteBotAgent", kind: "message", oneof: "result", T: () => DeleteBotAgentResult }
13613
14496
  ]);
13614
14497
  }
13615
14498
  create(value) {
@@ -14384,6 +15267,36 @@ class RpcResult$Type extends import_runtime4.MessageType {
14384
15267
  getSpace: GetSpaceResult.internalBinaryRead(reader, reader.uint32(), options, message.result.getSpace)
14385
15268
  };
14386
15269
  break;
15270
+ case 129:
15271
+ message.result = {
15272
+ oneofKind: "connectAgentSession",
15273
+ connectAgentSession: ConnectAgentSessionResult.internalBinaryRead(reader, reader.uint32(), options, message.result.connectAgentSession)
15274
+ };
15275
+ break;
15276
+ case 130:
15277
+ message.result = {
15278
+ oneofKind: "syncAgentSessionMessages",
15279
+ syncAgentSessionMessages: SyncAgentSessionMessagesResult.internalBinaryRead(reader, reader.uint32(), options, message.result.syncAgentSessionMessages)
15280
+ };
15281
+ break;
15282
+ case 131:
15283
+ message.result = {
15284
+ oneofKind: "getAgentSession",
15285
+ getAgentSession: GetAgentSessionResult.internalBinaryRead(reader, reader.uint32(), options, message.result.getAgentSession)
15286
+ };
15287
+ break;
15288
+ case 132:
15289
+ message.result = {
15290
+ oneofKind: "updateBotAgent",
15291
+ updateBotAgent: UpdateBotAgentResult.internalBinaryRead(reader, reader.uint32(), options, message.result.updateBotAgent)
15292
+ };
15293
+ break;
15294
+ case 133:
15295
+ message.result = {
15296
+ oneofKind: "deleteBotAgent",
15297
+ deleteBotAgent: DeleteBotAgentResult.internalBinaryRead(reader, reader.uint32(), options, message.result.deleteBotAgent)
15298
+ };
15299
+ break;
14387
15300
  default:
14388
15301
  let u = options.readUnknownField;
14389
15302
  if (u === "throw")
@@ -14650,6 +15563,16 @@ class RpcResult$Type extends import_runtime4.MessageType {
14650
15563
  DeleteDialogFolderResult.internalBinaryWrite(message.result.deleteDialogFolder, writer.tag(127, import_runtime.WireType.LengthDelimited).fork(), options).join();
14651
15564
  if (message.result.oneofKind === "getSpace")
14652
15565
  GetSpaceResult.internalBinaryWrite(message.result.getSpace, writer.tag(128, import_runtime.WireType.LengthDelimited).fork(), options).join();
15566
+ if (message.result.oneofKind === "connectAgentSession")
15567
+ ConnectAgentSessionResult.internalBinaryWrite(message.result.connectAgentSession, writer.tag(129, import_runtime.WireType.LengthDelimited).fork(), options).join();
15568
+ if (message.result.oneofKind === "syncAgentSessionMessages")
15569
+ SyncAgentSessionMessagesResult.internalBinaryWrite(message.result.syncAgentSessionMessages, writer.tag(130, import_runtime.WireType.LengthDelimited).fork(), options).join();
15570
+ if (message.result.oneofKind === "getAgentSession")
15571
+ GetAgentSessionResult.internalBinaryWrite(message.result.getAgentSession, writer.tag(131, import_runtime.WireType.LengthDelimited).fork(), options).join();
15572
+ if (message.result.oneofKind === "updateBotAgent")
15573
+ UpdateBotAgentResult.internalBinaryWrite(message.result.updateBotAgent, writer.tag(132, import_runtime.WireType.LengthDelimited).fork(), options).join();
15574
+ if (message.result.oneofKind === "deleteBotAgent")
15575
+ DeleteBotAgentResult.internalBinaryWrite(message.result.deleteBotAgent, writer.tag(133, import_runtime.WireType.LengthDelimited).fork(), options).join();
14653
15576
  let u = options.writeUnknownFields;
14654
15577
  if (u !== false)
14655
15578
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -16117,7 +17040,8 @@ var GetGridHomeResult = new GetGridHomeResult$Type;
16117
17040
  class CreateGridRoomInput$Type extends import_runtime4.MessageType {
16118
17041
  constructor() {
16119
17042
  super("CreateGridRoomInput", [
16120
- { no: 1, name: "space_id", kind: "scalar", T: 3, L: 0 }
17043
+ { no: 1, name: "space_id", kind: "scalar", T: 3, L: 0 },
17044
+ { no: 2, name: "microphone_enabled", kind: "scalar", opt: true, T: 8 }
16121
17045
  ]);
16122
17046
  }
16123
17047
  create(value) {
@@ -16135,6 +17059,9 @@ class CreateGridRoomInput$Type extends import_runtime4.MessageType {
16135
17059
  case 1:
16136
17060
  message.spaceId = reader.int64().toBigInt();
16137
17061
  break;
17062
+ case 2:
17063
+ message.microphoneEnabled = reader.bool();
17064
+ break;
16138
17065
  default:
16139
17066
  let u = options.readUnknownField;
16140
17067
  if (u === "throw")
@@ -16149,6 +17076,8 @@ class CreateGridRoomInput$Type extends import_runtime4.MessageType {
16149
17076
  internalBinaryWrite(message, writer, options) {
16150
17077
  if (message.spaceId !== 0n)
16151
17078
  writer.tag(1, import_runtime.WireType.Varint).int64(message.spaceId);
17079
+ if (message.microphoneEnabled !== undefined)
17080
+ writer.tag(2, import_runtime.WireType.Varint).bool(message.microphoneEnabled);
16152
17081
  let u = options.writeUnknownFields;
16153
17082
  if (u !== false)
16154
17083
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -16209,7 +17138,8 @@ var CreateGridRoomResult = new CreateGridRoomResult$Type;
16209
17138
  class JoinGridRoomInput$Type extends import_runtime4.MessageType {
16210
17139
  constructor() {
16211
17140
  super("JoinGridRoomInput", [
16212
- { no: 1, name: "room_id", kind: "scalar", T: 3, L: 0 }
17141
+ { no: 1, name: "room_id", kind: "scalar", T: 3, L: 0 },
17142
+ { no: 2, name: "microphone_enabled", kind: "scalar", opt: true, T: 8 }
16213
17143
  ]);
16214
17144
  }
16215
17145
  create(value) {
@@ -16227,6 +17157,9 @@ class JoinGridRoomInput$Type extends import_runtime4.MessageType {
16227
17157
  case 1:
16228
17158
  message.roomId = reader.int64().toBigInt();
16229
17159
  break;
17160
+ case 2:
17161
+ message.microphoneEnabled = reader.bool();
17162
+ break;
16230
17163
  default:
16231
17164
  let u = options.readUnknownField;
16232
17165
  if (u === "throw")
@@ -16241,6 +17174,8 @@ class JoinGridRoomInput$Type extends import_runtime4.MessageType {
16241
17174
  internalBinaryWrite(message, writer, options) {
16242
17175
  if (message.roomId !== 0n)
16243
17176
  writer.tag(1, import_runtime.WireType.Varint).int64(message.roomId);
17177
+ if (message.microphoneEnabled !== undefined)
17178
+ writer.tag(2, import_runtime.WireType.Varint).bool(message.microphoneEnabled);
16244
17179
  let u = options.writeUnknownFields;
16245
17180
  if (u !== false)
16246
17181
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -18622,17 +19557,92 @@ class BotAgent$Type extends import_runtime4.MessageType {
18622
19557
  writer.tag(5, import_runtime.WireType.LengthDelimited).string(message.emoji);
18623
19558
  if (message.description !== undefined)
18624
19559
  writer.tag(6, import_runtime.WireType.LengthDelimited).string(message.description);
18625
- if (message.skillKey !== undefined)
18626
- writer.tag(7, import_runtime.WireType.LengthDelimited).string(message.skillKey);
18627
- if (message.instructions !== undefined)
18628
- writer.tag(8, import_runtime.WireType.LengthDelimited).string(message.instructions);
19560
+ if (message.skillKey !== undefined)
19561
+ writer.tag(7, import_runtime.WireType.LengthDelimited).string(message.skillKey);
19562
+ if (message.instructions !== undefined)
19563
+ writer.tag(8, import_runtime.WireType.LengthDelimited).string(message.instructions);
19564
+ let u = options.writeUnknownFields;
19565
+ if (u !== false)
19566
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
19567
+ return writer;
19568
+ }
19569
+ }
19570
+ var BotAgent = new BotAgent$Type;
19571
+
19572
+ class BotAgentProfile$Type extends import_runtime4.MessageType {
19573
+ constructor() {
19574
+ super("BotAgentProfile", [
19575
+ { no: 1, name: "id", kind: "scalar", T: 3, L: 0 },
19576
+ { no: 2, name: "bot_user_id", kind: "scalar", T: 3, L: 0 },
19577
+ { no: 3, name: "name", kind: "scalar", T: 9 },
19578
+ { no: 4, name: "handle", kind: "scalar", opt: true, T: 9 },
19579
+ { no: 5, name: "emoji", kind: "scalar", opt: true, T: 9 },
19580
+ { no: 6, name: "description", kind: "scalar", opt: true, T: 9 }
19581
+ ]);
19582
+ }
19583
+ create(value) {
19584
+ const message = globalThis.Object.create(this.messagePrototype);
19585
+ message.id = 0n;
19586
+ message.botUserId = 0n;
19587
+ message.name = "";
19588
+ if (value !== undefined)
19589
+ import_runtime3.reflectionMergePartial(this, message, value);
19590
+ return message;
19591
+ }
19592
+ internalBinaryRead(reader, length, options, target) {
19593
+ let message = target ?? this.create(), end = reader.pos + length;
19594
+ while (reader.pos < end) {
19595
+ let [fieldNo, wireType] = reader.tag();
19596
+ switch (fieldNo) {
19597
+ case 1:
19598
+ message.id = reader.int64().toBigInt();
19599
+ break;
19600
+ case 2:
19601
+ message.botUserId = reader.int64().toBigInt();
19602
+ break;
19603
+ case 3:
19604
+ message.name = reader.string();
19605
+ break;
19606
+ case 4:
19607
+ message.handle = reader.string();
19608
+ break;
19609
+ case 5:
19610
+ message.emoji = reader.string();
19611
+ break;
19612
+ case 6:
19613
+ message.description = reader.string();
19614
+ break;
19615
+ default:
19616
+ let u = options.readUnknownField;
19617
+ if (u === "throw")
19618
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
19619
+ let d = reader.skip(wireType);
19620
+ if (u !== false)
19621
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
19622
+ }
19623
+ }
19624
+ return message;
19625
+ }
19626
+ internalBinaryWrite(message, writer, options) {
19627
+ if (message.id !== 0n)
19628
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.id);
19629
+ if (message.botUserId !== 0n)
19630
+ writer.tag(2, import_runtime.WireType.Varint).int64(message.botUserId);
19631
+ if (message.name !== "")
19632
+ writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.name);
19633
+ if (message.handle !== undefined)
19634
+ writer.tag(4, import_runtime.WireType.LengthDelimited).string(message.handle);
19635
+ if (message.emoji !== undefined)
19636
+ writer.tag(5, import_runtime.WireType.LengthDelimited).string(message.emoji);
19637
+ if (message.description !== undefined)
19638
+ writer.tag(6, import_runtime.WireType.LengthDelimited).string(message.description);
18629
19639
  let u = options.writeUnknownFields;
18630
19640
  if (u !== false)
18631
19641
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
18632
19642
  return writer;
18633
19643
  }
18634
19644
  }
18635
- var BotAgent = new BotAgent$Type;
19645
+ var BotAgentProfile = new BotAgentProfile$Type;
18636
19646
 
18637
19647
  class CreateBotAgentInput$Type extends import_runtime4.MessageType {
18638
19648
  constructor() {
@@ -18933,6 +19943,213 @@ class ListBotAgentsResult$Type extends import_runtime4.MessageType {
18933
19943
  }
18934
19944
  var ListBotAgentsResult = new ListBotAgentsResult$Type;
18935
19945
 
19946
+ class UpdateBotAgentInput$Type extends import_runtime4.MessageType {
19947
+ constructor() {
19948
+ super("UpdateBotAgentInput", [
19949
+ { no: 1, name: "agent_id", kind: "scalar", T: 3, L: 0 },
19950
+ { no: 2, name: "name", kind: "scalar", opt: true, T: 9 },
19951
+ { no: 3, name: "handle", kind: "scalar", opt: true, T: 9 },
19952
+ { no: 4, name: "emoji", kind: "scalar", opt: true, T: 9 },
19953
+ { no: 5, name: "description", kind: "scalar", opt: true, T: 9 },
19954
+ { no: 6, name: "skill_key", kind: "scalar", opt: true, T: 9 },
19955
+ { no: 7, name: "instructions", kind: "scalar", opt: true, T: 9 }
19956
+ ]);
19957
+ }
19958
+ create(value) {
19959
+ const message = globalThis.Object.create(this.messagePrototype);
19960
+ message.agentId = 0n;
19961
+ if (value !== undefined)
19962
+ import_runtime3.reflectionMergePartial(this, message, value);
19963
+ return message;
19964
+ }
19965
+ internalBinaryRead(reader, length, options, target) {
19966
+ let message = target ?? this.create(), end = reader.pos + length;
19967
+ while (reader.pos < end) {
19968
+ let [fieldNo, wireType] = reader.tag();
19969
+ switch (fieldNo) {
19970
+ case 1:
19971
+ message.agentId = reader.int64().toBigInt();
19972
+ break;
19973
+ case 2:
19974
+ message.name = reader.string();
19975
+ break;
19976
+ case 3:
19977
+ message.handle = reader.string();
19978
+ break;
19979
+ case 4:
19980
+ message.emoji = reader.string();
19981
+ break;
19982
+ case 5:
19983
+ message.description = reader.string();
19984
+ break;
19985
+ case 6:
19986
+ message.skillKey = reader.string();
19987
+ break;
19988
+ case 7:
19989
+ message.instructions = reader.string();
19990
+ break;
19991
+ default:
19992
+ let u = options.readUnknownField;
19993
+ if (u === "throw")
19994
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
19995
+ let d = reader.skip(wireType);
19996
+ if (u !== false)
19997
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
19998
+ }
19999
+ }
20000
+ return message;
20001
+ }
20002
+ internalBinaryWrite(message, writer, options) {
20003
+ if (message.agentId !== 0n)
20004
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.agentId);
20005
+ if (message.name !== undefined)
20006
+ writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.name);
20007
+ if (message.handle !== undefined)
20008
+ writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.handle);
20009
+ if (message.emoji !== undefined)
20010
+ writer.tag(4, import_runtime.WireType.LengthDelimited).string(message.emoji);
20011
+ if (message.description !== undefined)
20012
+ writer.tag(5, import_runtime.WireType.LengthDelimited).string(message.description);
20013
+ if (message.skillKey !== undefined)
20014
+ writer.tag(6, import_runtime.WireType.LengthDelimited).string(message.skillKey);
20015
+ if (message.instructions !== undefined)
20016
+ writer.tag(7, import_runtime.WireType.LengthDelimited).string(message.instructions);
20017
+ let u = options.writeUnknownFields;
20018
+ if (u !== false)
20019
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
20020
+ return writer;
20021
+ }
20022
+ }
20023
+ var UpdateBotAgentInput = new UpdateBotAgentInput$Type;
20024
+
20025
+ class UpdateBotAgentResult$Type extends import_runtime4.MessageType {
20026
+ constructor() {
20027
+ super("UpdateBotAgentResult", [
20028
+ { no: 1, name: "agent", kind: "message", T: () => BotAgent }
20029
+ ]);
20030
+ }
20031
+ create(value) {
20032
+ const message = globalThis.Object.create(this.messagePrototype);
20033
+ if (value !== undefined)
20034
+ import_runtime3.reflectionMergePartial(this, message, value);
20035
+ return message;
20036
+ }
20037
+ internalBinaryRead(reader, length, options, target) {
20038
+ let message = target ?? this.create(), end = reader.pos + length;
20039
+ while (reader.pos < end) {
20040
+ let [fieldNo, wireType] = reader.tag();
20041
+ switch (fieldNo) {
20042
+ case 1:
20043
+ message.agent = BotAgent.internalBinaryRead(reader, reader.uint32(), options, message.agent);
20044
+ break;
20045
+ default:
20046
+ let u = options.readUnknownField;
20047
+ if (u === "throw")
20048
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
20049
+ let d = reader.skip(wireType);
20050
+ if (u !== false)
20051
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
20052
+ }
20053
+ }
20054
+ return message;
20055
+ }
20056
+ internalBinaryWrite(message, writer, options) {
20057
+ if (message.agent)
20058
+ BotAgent.internalBinaryWrite(message.agent, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
20059
+ let u = options.writeUnknownFields;
20060
+ if (u !== false)
20061
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
20062
+ return writer;
20063
+ }
20064
+ }
20065
+ var UpdateBotAgentResult = new UpdateBotAgentResult$Type;
20066
+
20067
+ class DeleteBotAgentInput$Type extends import_runtime4.MessageType {
20068
+ constructor() {
20069
+ super("DeleteBotAgentInput", [
20070
+ { no: 1, name: "agent_id", kind: "scalar", T: 3, L: 0 }
20071
+ ]);
20072
+ }
20073
+ create(value) {
20074
+ const message = globalThis.Object.create(this.messagePrototype);
20075
+ message.agentId = 0n;
20076
+ if (value !== undefined)
20077
+ import_runtime3.reflectionMergePartial(this, message, value);
20078
+ return message;
20079
+ }
20080
+ internalBinaryRead(reader, length, options, target) {
20081
+ let message = target ?? this.create(), end = reader.pos + length;
20082
+ while (reader.pos < end) {
20083
+ let [fieldNo, wireType] = reader.tag();
20084
+ switch (fieldNo) {
20085
+ case 1:
20086
+ message.agentId = reader.int64().toBigInt();
20087
+ break;
20088
+ default:
20089
+ let u = options.readUnknownField;
20090
+ if (u === "throw")
20091
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
20092
+ let d = reader.skip(wireType);
20093
+ if (u !== false)
20094
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
20095
+ }
20096
+ }
20097
+ return message;
20098
+ }
20099
+ internalBinaryWrite(message, writer, options) {
20100
+ if (message.agentId !== 0n)
20101
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.agentId);
20102
+ let u = options.writeUnknownFields;
20103
+ if (u !== false)
20104
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
20105
+ return writer;
20106
+ }
20107
+ }
20108
+ var DeleteBotAgentInput = new DeleteBotAgentInput$Type;
20109
+
20110
+ class DeleteBotAgentResult$Type extends import_runtime4.MessageType {
20111
+ constructor() {
20112
+ super("DeleteBotAgentResult", [
20113
+ { no: 1, name: "agent_id", kind: "scalar", T: 3, L: 0 }
20114
+ ]);
20115
+ }
20116
+ create(value) {
20117
+ const message = globalThis.Object.create(this.messagePrototype);
20118
+ message.agentId = 0n;
20119
+ if (value !== undefined)
20120
+ import_runtime3.reflectionMergePartial(this, message, value);
20121
+ return message;
20122
+ }
20123
+ internalBinaryRead(reader, length, options, target) {
20124
+ let message = target ?? this.create(), end = reader.pos + length;
20125
+ while (reader.pos < end) {
20126
+ let [fieldNo, wireType] = reader.tag();
20127
+ switch (fieldNo) {
20128
+ case 1:
20129
+ message.agentId = reader.int64().toBigInt();
20130
+ break;
20131
+ default:
20132
+ let u = options.readUnknownField;
20133
+ if (u === "throw")
20134
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
20135
+ let d = reader.skip(wireType);
20136
+ if (u !== false)
20137
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
20138
+ }
20139
+ }
20140
+ return message;
20141
+ }
20142
+ internalBinaryWrite(message, writer, options) {
20143
+ if (message.agentId !== 0n)
20144
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.agentId);
20145
+ let u = options.writeUnknownFields;
20146
+ if (u !== false)
20147
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
20148
+ return writer;
20149
+ }
20150
+ }
20151
+ var DeleteBotAgentResult = new DeleteBotAgentResult$Type;
20152
+
18936
20153
  class ListBotsInput$Type extends import_runtime4.MessageType {
18937
20154
  constructor() {
18938
20155
  super("ListBotsInput", []);
@@ -26356,7 +27573,8 @@ class CreateChatInput$Type extends import_runtime4.MessageType {
26356
27573
  { no: 4, name: "emoji", kind: "scalar", opt: true, T: 9 },
26357
27574
  { no: 5, name: "is_public", kind: "scalar", T: 8 },
26358
27575
  { no: 6, name: "participants", kind: "message", repeat: 1, T: () => InputChatParticipant },
26359
- { no: 7, name: "reserved_chat_id", kind: "scalar", opt: true, T: 3, L: 0 }
27576
+ { no: 7, name: "reserved_chat_id", kind: "scalar", opt: true, T: 3, L: 0 },
27577
+ { no: 8, name: "placeholder_title", kind: "scalar", opt: true, T: 9 }
26360
27578
  ]);
26361
27579
  }
26362
27580
  create(value) {
@@ -26393,6 +27611,9 @@ class CreateChatInput$Type extends import_runtime4.MessageType {
26393
27611
  case 7:
26394
27612
  message.reservedChatId = reader.int64().toBigInt();
26395
27613
  break;
27614
+ case 8:
27615
+ message.placeholderTitle = reader.string();
27616
+ break;
26396
27617
  default:
26397
27618
  let u = options.readUnknownField;
26398
27619
  if (u === "throw")
@@ -26419,6 +27640,8 @@ class CreateChatInput$Type extends import_runtime4.MessageType {
26419
27640
  InputChatParticipant.internalBinaryWrite(message.participants[i], writer.tag(6, import_runtime.WireType.LengthDelimited).fork(), options).join();
26420
27641
  if (message.reservedChatId !== undefined)
26421
27642
  writer.tag(7, import_runtime.WireType.Varint).int64(message.reservedChatId);
27643
+ if (message.placeholderTitle !== undefined)
27644
+ writer.tag(8, import_runtime.WireType.LengthDelimited).string(message.placeholderTitle);
26422
27645
  let u = options.writeUnknownFields;
26423
27646
  if (u !== false)
26424
27647
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -31427,12 +32650,14 @@ class PeerBot$Type extends import_runtime4.MessageType {
31427
32650
  constructor() {
31428
32651
  super("PeerBot", [
31429
32652
  { no: 1, name: "bot", kind: "message", T: () => User },
31430
- { no: 2, name: "capabilities", kind: "message", repeat: 1, T: () => BotCapability }
32653
+ { no: 2, name: "capabilities", kind: "message", repeat: 1, T: () => BotCapability },
32654
+ { no: 3, name: "agents", kind: "message", repeat: 1, T: () => BotAgentProfile }
31431
32655
  ]);
31432
32656
  }
31433
32657
  create(value) {
31434
32658
  const message = globalThis.Object.create(this.messagePrototype);
31435
32659
  message.capabilities = [];
32660
+ message.agents = [];
31436
32661
  if (value !== undefined)
31437
32662
  import_runtime3.reflectionMergePartial(this, message, value);
31438
32663
  return message;
@@ -31448,6 +32673,9 @@ class PeerBot$Type extends import_runtime4.MessageType {
31448
32673
  case 2:
31449
32674
  message.capabilities.push(BotCapability.internalBinaryRead(reader, reader.uint32(), options));
31450
32675
  break;
32676
+ case 3:
32677
+ message.agents.push(BotAgentProfile.internalBinaryRead(reader, reader.uint32(), options));
32678
+ break;
31451
32679
  default:
31452
32680
  let u = options.readUnknownField;
31453
32681
  if (u === "throw")
@@ -31464,6 +32692,8 @@ class PeerBot$Type extends import_runtime4.MessageType {
31464
32692
  User.internalBinaryWrite(message.bot, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
31465
32693
  for (let i = 0;i < message.capabilities.length; i++)
31466
32694
  BotCapability.internalBinaryWrite(message.capabilities[i], writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
32695
+ for (let i = 0;i < message.agents.length; i++)
32696
+ BotAgentProfile.internalBinaryWrite(message.agents[i], writer.tag(3, import_runtime.WireType.LengthDelimited).fork(), options).join();
31467
32697
  let u = options.writeUnknownFields;
31468
32698
  if (u !== false)
31469
32699
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -41145,12 +42375,17 @@ var rpcInputKindByMethod = {
41145
42375
  79: "requestBotChatSettings",
41146
42376
  80: "invokeBotChatSettingsItem",
41147
42377
  81: "answerBotChatSettings",
42378
+ 106: "createBotAgent",
42379
+ 107: "getBotAgent",
42380
+ 108: "listBotAgents",
41148
42381
  117: "createUpload",
41149
42382
  118: "saveUploadPart",
41150
42383
  119: "getUploadState",
41151
42384
  120: "finishUpload",
41152
42385
  121: "cancelUpload",
41153
- 127: "getSpace"
42386
+ 127: "getSpace",
42387
+ 131: "updateBotAgent",
42388
+ 132: "deleteBotAgent"
41154
42389
  };
41155
42390
  var rpcResultKindByMethod = {
41156
42391
  0: undefined,
@@ -41209,12 +42444,17 @@ var rpcResultKindByMethod = {
41209
42444
  79: "requestBotChatSettings",
41210
42445
  80: "invokeBotChatSettingsItem",
41211
42446
  81: "answerBotChatSettings",
42447
+ 106: "createBotAgent",
42448
+ 107: "getBotAgent",
42449
+ 108: "listBotAgents",
41212
42450
  117: "createUpload",
41213
42451
  118: "saveUploadPart",
41214
42452
  119: "getUploadState",
41215
42453
  120: "finishUpload",
41216
42454
  121: "cancelUpload",
41217
- 127: "getSpace"
42455
+ 127: "getSpace",
42456
+ 131: "updateBotAgent",
42457
+ 132: "deleteBotAgent"
41218
42458
  };
41219
42459
 
41220
42460
  // node_modules/@inline-chat/realtime-sdk/dist/sdk/logger.js
@@ -43561,6 +44801,15 @@ function toInputMedia(media) {
43561
44801
  }
43562
44802
  }
43563
44803
  };
44804
+ case "voice":
44805
+ return {
44806
+ media: {
44807
+ oneofKind: "voice",
44808
+ voice: {
44809
+ voiceId: asInlineId(media.voiceId, "voiceId")
44810
+ }
44811
+ }
44812
+ };
43564
44813
  }
43565
44814
  }
43566
44815
  function normalizeHttpBaseUrl(baseUrl) {
@@ -44034,7 +45283,9 @@ function normalizeUploadKind(raw, filePath) {
44034
45283
  return "photo";
44035
45284
  if (raw === "video")
44036
45285
  return "video";
44037
- if (raw === "document" || raw === "file" || raw === "voice")
45286
+ if (raw === "voice")
45287
+ return "voice";
45288
+ if (raw === "document" || raw === "file")
44038
45289
  return "document";
44039
45290
  const lower = filePath.toLowerCase();
44040
45291
  if (/\.(png|jpg|jpeg|gif|webp|heic|heif)$/.test(lower))
@@ -44322,19 +45573,40 @@ class InlineUserDirectory {
44322
45573
  this.onError = options.onError;
44323
45574
  }
44324
45575
  async resolve(params) {
44325
- const userId = params.userId.toString();
44326
- const cached2 = this.getFresh(userId);
45576
+ const cached2 = this.getFresh(params.userId.toString());
44327
45577
  if (hasDisplayIdentity(cached2))
44328
45578
  return cached2;
45579
+ return (await this.resolveWithProvenance(params)).profile;
45580
+ }
45581
+ async resolveWithProvenance(params) {
45582
+ const userId = params.userId.toString();
45583
+ const cached2 = this.getFresh(userId);
45584
+ if (hasDisplayIdentity(cached2) && cached2.bot != null) {
45585
+ return { profile: cached2, provenanceVerified: true };
45586
+ }
44329
45587
  if (params.direct) {
44330
- await this.hydrateDirectory();
45588
+ const directoryHydrated = await this.hydrateDirectory();
45589
+ const resolved = this.getFresh(userId);
45590
+ return {
45591
+ ...hasDisplayIdentity(resolved) ? { profile: resolved } : {},
45592
+ provenanceVerified: directoryHydrated
45593
+ };
44331
45594
  } else {
44332
- await this.hydrateChat(params.chatId);
44333
- if (!hasDisplayIdentity(this.getFresh(userId)))
44334
- await this.hydrateDirectory();
45595
+ const chatHydrated = await this.hydrateChat(params.chatId);
45596
+ const participant = this.getFresh(userId);
45597
+ if (hasDisplayIdentity(participant)) {
45598
+ return {
45599
+ profile: participant,
45600
+ provenanceVerified: chatHydrated || participant.bot != null
45601
+ };
45602
+ }
45603
+ const directoryHydrated = await this.hydrateDirectory();
45604
+ const resolved = this.getFresh(userId);
45605
+ return {
45606
+ ...hasDisplayIdentity(resolved) ? { profile: resolved } : {},
45607
+ provenanceVerified: directoryHydrated && (chatHydrated || hasDisplayIdentity(resolved))
45608
+ };
44335
45609
  }
44336
- const resolved = this.getFresh(userId);
44337
- return hasDisplayIdentity(resolved) ? resolved : undefined;
44338
45610
  }
44339
45611
  remember(users) {
44340
45612
  const expiresAt = this.now() + this.ttlMs;
@@ -44347,7 +45619,8 @@ class InlineUserDirectory {
44347
45619
  id,
44348
45620
  ...readProfileField(user.firstName, previous?.firstName, "firstName"),
44349
45621
  ...readProfileField(user.lastName, previous?.lastName, "lastName"),
44350
- ...readProfileField(user.username, previous?.username, "username")
45622
+ ...readProfileField(user.username, previous?.username, "username"),
45623
+ ...readBooleanProfileField(user.bot, previous?.bot, "bot")
44351
45624
  };
44352
45625
  this.profiles.delete(id);
44353
45626
  this.profiles.set(id, { profile, expiresAt });
@@ -44383,7 +45656,7 @@ class InlineUserDirectory {
44383
45656
  if (hydratedUntil > this.now()) {
44384
45657
  this.hydratedChats.delete(key);
44385
45658
  this.hydratedChats.set(key, hydratedUntil);
44386
- return;
45659
+ return true;
44387
45660
  }
44388
45661
  this.hydratedChats.delete(key);
44389
45662
  const existing = this.chatFetches.get(key);
@@ -44403,13 +45676,17 @@ class InlineUserDirectory {
44403
45676
  break;
44404
45677
  this.hydratedChats.delete(oldest);
44405
45678
  }
44406
- })().catch((error) => this.onError?.("getChatParticipants", error)).finally(() => this.chatFetches.delete(key));
45679
+ return true;
45680
+ })().catch((error) => {
45681
+ this.onError?.("getChatParticipants", error);
45682
+ return false;
45683
+ }).finally(() => this.chatFetches.delete(key));
44407
45684
  this.chatFetches.set(key, fetch2);
44408
- await fetch2;
45685
+ return await fetch2;
44409
45686
  }
44410
45687
  async hydrateDirectory() {
44411
45688
  if (this.directoryExpiresAt > this.now())
44412
- return;
45689
+ return true;
44413
45690
  if (this.directoryFetch)
44414
45691
  return this.directoryFetch;
44415
45692
  const fetch2 = (async () => {
@@ -44419,21 +45696,29 @@ class InlineUserDirectory {
44419
45696
  });
44420
45697
  this.remember(readUsers(result, "getChats"));
44421
45698
  this.directoryExpiresAt = this.now() + this.ttlMs;
44422
- })().catch((error) => this.onError?.("getChats", error)).finally(() => {
45699
+ return true;
45700
+ })().catch((error) => {
45701
+ this.onError?.("getChats", error);
45702
+ return false;
45703
+ }).finally(() => {
44423
45704
  this.directoryFetch = null;
44424
45705
  });
44425
45706
  this.directoryFetch = fetch2;
44426
- await fetch2;
45707
+ return await fetch2;
44427
45708
  }
44428
45709
  }
44429
45710
  function hasDisplayIdentity(profile) {
44430
- return Boolean(profile?.firstName || profile?.lastName || profile?.username);
45711
+ return Boolean(profile?.firstName || profile?.lastName || profile?.username || profile?.bot != null);
44431
45712
  }
44432
45713
  function readProfileField(value, previous, key) {
44433
45714
  const normalized = typeof value === "string" ? value.trim() : "";
44434
45715
  const resolved = normalized || previous;
44435
45716
  return resolved ? { [key]: resolved } : {};
44436
45717
  }
45718
+ function readBooleanProfileField(value, previous, key) {
45719
+ const resolved = value ?? previous;
45720
+ return resolved == null ? {} : { [key]: resolved };
45721
+ }
44437
45722
  function readUsers(result, kind) {
44438
45723
  if (!result || typeof result !== "object")
44439
45724
  return [];
@@ -44543,8 +45828,9 @@ async function connectClientLoop() {
44543
45828
  async function consumeEvents() {
44544
45829
  try {
44545
45830
  for await (const event of client.events()) {
44546
- const sender = await resolveInboundSender(event);
44547
- await deliver(normalizeInboundEvent(event, meId, sender, meUsername));
45831
+ const senderResolution = await resolveInboundSender(event);
45832
+ const normalized = normalizeInboundEvent(event, meId, senderResolution.profile, meUsername);
45833
+ await deliver(senderResolution.provenanceVerified ? normalized : { ...asRecord(normalized), _inlineSenderProvenanceVerified: false });
44548
45834
  }
44549
45835
  } catch (error) {
44550
45836
  if (!stopping) {
@@ -44662,6 +45948,15 @@ async function handleRequest(req, res) {
44662
45948
  case "/get-agent":
44663
45949
  await endpointGetAgent(res, body);
44664
45950
  return;
45951
+ case "/list-agents":
45952
+ await endpointListAgents(res);
45953
+ return;
45954
+ case "/update-agent":
45955
+ await endpointUpdateAgent(res, body);
45956
+ return;
45957
+ case "/delete-agent":
45958
+ await endpointDeleteAgent(res, body);
45959
+ return;
44665
45960
  case "/answer-action":
44666
45961
  await endpointAnswerAction(res, body);
44667
45962
  return;
@@ -44689,10 +45984,9 @@ async function endpointSend(res, body) {
44689
45984
  throw new SidecarError("send requires text or media", "bad_format");
44690
45985
  }
44691
45986
  const params = {
44692
- ...text ? { text } : {},
45987
+ ...text ? { text, parseMarkdown } : {},
44693
45988
  ...media ? { media } : {},
44694
45989
  ...replyToMsgId ? { replyToMsgId } : {},
44695
- parseMarkdown,
44696
45990
  ...actions ? { actions } : {},
44697
45991
  ...sendMode === "silent" ? { sendMode: "silent" } : {}
44698
45992
  };
@@ -44760,6 +46054,7 @@ async function endpointSendAttachment(res, body) {
44760
46054
  const filePath = readRequiredString(record2, "path");
44761
46055
  const kind = normalizeUploadKind(readOptionalString(record2, "kind"), filePath);
44762
46056
  const caption = readOptionalString(record2, "caption");
46057
+ const parseMarkdown = readOptionalBoolean(record2, "parseMarkdown") ?? true;
44763
46058
  const replyToMsgId = readOptionalInlineId(record2, "replyToMsgId");
44764
46059
  const fileName = readOptionalString(record2, "fileName") || path.basename(filePath);
44765
46060
  const contentType = readOptionalString(record2, "mimeType");
@@ -44773,12 +46068,12 @@ async function endpointSendAttachment(res, body) {
44773
46068
  fileName,
44774
46069
  ...contentType ? { contentType } : {}
44775
46070
  });
44776
- const media = kind === "photo" && upload.photoId != null ? { kind: "photo", photoId: upload.photoId } : kind === "video" && upload.videoId != null ? { kind: "video", videoId: upload.videoId } : upload.documentId != null ? { kind: "document", documentId: upload.documentId } : null;
46071
+ const media = kind === "photo" && upload.photoId != null ? { kind: "photo", photoId: upload.photoId } : kind === "video" && upload.videoId != null ? { kind: "video", videoId: upload.videoId } : kind === "voice" && upload.voiceId != null ? { kind: "voice", voiceId: upload.voiceId } : upload.documentId != null ? { kind: "document", documentId: upload.documentId } : null;
44777
46072
  if (!media)
44778
46073
  throw new SidecarError("upload did not return a sendable media id", "unknown");
44779
46074
  const sendParams = {
44780
46075
  media,
44781
- ...caption ? { text: caption, parseMarkdown: true } : {},
46076
+ ...caption ? { text: caption, parseMarkdown } : {},
44782
46077
  ...replyToMsgId ? { replyToMsgId } : {}
44783
46078
  };
44784
46079
  const sent = "chatId" in target ? await client.sendMessage({ chatId: target.chatId, ...sendParams }) : await client.sendMessage({ userId: target.userId, ...sendParams });
@@ -45115,6 +46410,56 @@ async function endpointGetAgent(res, body) {
45115
46410
  }
45116
46411
  writeJson(res, 200, { ok: true, result: safeJson(result) });
45117
46412
  }
46413
+ async function endpointListAgents(res) {
46414
+ const result = await callBotApi("getMyAgents", "GET");
46415
+ writeJson(res, 200, { ok: true, result: safeJson(result) });
46416
+ }
46417
+ function readAgentPatchString(record2, key) {
46418
+ if (!(key in record2))
46419
+ return;
46420
+ const value = record2[key];
46421
+ if (typeof value !== "string") {
46422
+ throw new SidecarError(`${key} must be a string`, "bad_format");
46423
+ }
46424
+ return value.trim();
46425
+ }
46426
+ async function endpointUpdateAgent(res, body) {
46427
+ const record2 = asRecord(body);
46428
+ const agentId = readRequiredInlineId(record2, "agentId");
46429
+ const name = readAgentPatchString(record2, "name");
46430
+ if (name !== undefined && !name) {
46431
+ throw new SidecarError("name cannot be empty", "bad_format");
46432
+ }
46433
+ const patch = {
46434
+ ...name !== undefined ? { name } : {},
46435
+ ...agentPatchField(record2, "handle"),
46436
+ ...agentPatchField(record2, "emoji"),
46437
+ ...agentPatchField(record2, "description"),
46438
+ ...agentPatchField(record2, "skill_key"),
46439
+ ...agentPatchField(record2, "instructions")
46440
+ };
46441
+ if (Object.keys(patch).length === 0) {
46442
+ throw new SidecarError("update-agent requires at least one field", "bad_format");
46443
+ }
46444
+ const result = await callBotApi("updateAgent", "POST", {
46445
+ agent_id: String(agentId),
46446
+ ...patch
46447
+ });
46448
+ const agent = asOptionalRecord(result.agent);
46449
+ if (!agent)
46450
+ throw new SidecarError("update-agent returned no Agent", "unknown");
46451
+ writeJson(res, 200, { ok: true, result: { agent: safeJson(agent) } });
46452
+ }
46453
+ function agentPatchField(record2, key) {
46454
+ const value = readAgentPatchString(record2, key);
46455
+ return value === undefined ? {} : { [key]: value };
46456
+ }
46457
+ async function endpointDeleteAgent(res, body) {
46458
+ const record2 = asRecord(body);
46459
+ const agentId = readRequiredInlineId(record2, "agentId");
46460
+ const result = await callBotApi("deleteAgent", "POST", { agent_id: String(agentId) });
46461
+ writeJson(res, 200, { ok: true, result: safeJson(result) });
46462
+ }
45118
46463
  async function getRawChatSnapshot(chatId) {
45119
46464
  const result = await client.invoke(Method.GET_CHAT, {
45120
46465
  oneofKind: "getChat",
@@ -45185,8 +46530,8 @@ async function resolveInboundSender(event) {
45185
46530
  const userId = asPositiveBigInt(message?.fromId ?? event.actorUserId ?? reaction?.userId ?? event.userId ?? participant?.userId);
45186
46531
  const chatId = asPositiveBigInt(event.chatId ?? message?.chatId ?? reaction?.chatId);
45187
46532
  if (!userId || !chatId || userId.toString() === meId)
45188
- return;
45189
- return userDirectory.resolve({
46533
+ return { provenanceVerified: true };
46534
+ return userDirectory.resolveWithProvenance({
45190
46535
  userId,
45191
46536
  chatId,
45192
46537
  direct: message ? messagePeerIsDirect(message) : false
@@ -45390,6 +46735,8 @@ class MockInlineClient {
45390
46735
  return { fileUniqueId, photoId: this.uploadId };
45391
46736
  if (params.type === "video")
45392
46737
  return { fileUniqueId, videoId: this.uploadId };
46738
+ if (params.type === "voice")
46739
+ return { fileUniqueId, voiceId: this.uploadId };
45393
46740
  return { fileUniqueId, documentId: this.uploadId };
45394
46741
  }
45395
46742
  async sendTyping(params) {
@@ -45662,6 +47009,8 @@ function parseSendMedia(value) {
45662
47009
  return { kind, videoId: readRequiredInlineId(media, "videoId") };
45663
47010
  if (kind === "document")
45664
47011
  return { kind, documentId: readRequiredInlineId(media, "documentId") };
47012
+ if (kind === "voice")
47013
+ return { kind, voiceId: readRequiredInlineId(media, "voiceId") };
45665
47014
  throw new SidecarError(`unsupported media kind: ${kind}`, "bad_format");
45666
47015
  }
45667
47016
  function parseActions(value) {