@inline-chat/hermes-agent-adapter 0.0.1 → 0.0.3

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.
@@ -18,7 +18,7 @@ var __toESM = (mod, isNodeMode, target) => {
18
18
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
19
19
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
20
20
 
21
- // ../../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/json-typings.js
21
+ // ../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/json-typings.js
22
22
  var require_json_typings = __commonJS((exports) => {
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
24
  exports.isJsonObject = exports.typeofJsonValue = undefined;
@@ -39,7 +39,7 @@ var require_json_typings = __commonJS((exports) => {
39
39
  exports.isJsonObject = isJsonObject;
40
40
  });
41
41
 
42
- // ../../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/base64.js
42
+ // ../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/base64.js
43
43
  var require_base64 = __commonJS((exports) => {
44
44
  Object.defineProperty(exports, "__esModule", { value: true });
45
45
  exports.base64encode = exports.base64decode = undefined;
@@ -131,7 +131,7 @@ var require_base64 = __commonJS((exports) => {
131
131
  exports.base64encode = base64encode;
132
132
  });
133
133
 
134
- // ../../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/protobufjs-utf8.js
134
+ // ../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/protobufjs-utf8.js
135
135
  var require_protobufjs_utf8 = __commonJS((exports) => {
136
136
  Object.defineProperty(exports, "__esModule", { value: true });
137
137
  exports.utf8read = undefined;
@@ -168,7 +168,7 @@ var require_protobufjs_utf8 = __commonJS((exports) => {
168
168
  exports.utf8read = utf8read;
169
169
  });
170
170
 
171
- // ../../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/binary-format-contract.js
171
+ // ../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/binary-format-contract.js
172
172
  var require_binary_format_contract = __commonJS((exports) => {
173
173
  Object.defineProperty(exports, "__esModule", { value: true });
174
174
  exports.WireType = exports.mergeBinaryOptions = exports.UnknownFieldHandler = undefined;
@@ -208,7 +208,7 @@ var require_binary_format_contract = __commonJS((exports) => {
208
208
  })(WireType = exports.WireType || (exports.WireType = {}));
209
209
  });
210
210
 
211
- // ../../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/goog-varint.js
211
+ // ../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/goog-varint.js
212
212
  var require_goog_varint = __commonJS((exports) => {
213
213
  Object.defineProperty(exports, "__esModule", { value: true });
214
214
  exports.varint32read = exports.varint32write = exports.int64toString = exports.int64fromString = exports.varint64write = exports.varint64read = undefined;
@@ -375,7 +375,7 @@ var require_goog_varint = __commonJS((exports) => {
375
375
  exports.varint32read = varint32read;
376
376
  });
377
377
 
378
- // ../../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/pb-long.js
378
+ // ../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/pb-long.js
379
379
  var require_pb_long = __commonJS((exports) => {
380
380
  Object.defineProperty(exports, "__esModule", { value: true });
381
381
  exports.PbLong = exports.PbULong = exports.detectBi = undefined;
@@ -559,7 +559,7 @@ var require_pb_long = __commonJS((exports) => {
559
559
  PbLong.ZERO = new PbLong(0, 0);
560
560
  });
561
561
 
562
- // ../../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/binary-reader.js
562
+ // ../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/binary-reader.js
563
563
  var require_binary_reader = __commonJS((exports) => {
564
564
  Object.defineProperty(exports, "__esModule", { value: true });
565
565
  exports.BinaryReader = exports.binaryReadOptions = undefined;
@@ -681,7 +681,7 @@ var require_binary_reader = __commonJS((exports) => {
681
681
  exports.BinaryReader = BinaryReader;
682
682
  });
683
683
 
684
- // ../../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/assert.js
684
+ // ../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/assert.js
685
685
  var require_assert = __commonJS((exports) => {
686
686
  Object.defineProperty(exports, "__esModule", { value: true });
687
687
  exports.assertFloat32 = exports.assertUInt32 = exports.assertInt32 = exports.assertNever = exports.assert = undefined;
@@ -725,7 +725,7 @@ var require_assert = __commonJS((exports) => {
725
725
  exports.assertFloat32 = assertFloat32;
726
726
  });
727
727
 
728
- // ../../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/binary-writer.js
728
+ // ../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/binary-writer.js
729
729
  var require_binary_writer = __commonJS((exports) => {
730
730
  Object.defineProperty(exports, "__esModule", { value: true });
731
731
  exports.BinaryWriter = exports.binaryWriteOptions = undefined;
@@ -880,7 +880,7 @@ var require_binary_writer = __commonJS((exports) => {
880
880
  exports.BinaryWriter = BinaryWriter;
881
881
  });
882
882
 
883
- // ../../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/json-format-contract.js
883
+ // ../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/json-format-contract.js
884
884
  var require_json_format_contract = __commonJS((exports) => {
885
885
  Object.defineProperty(exports, "__esModule", { value: true });
886
886
  exports.mergeJsonOptions = exports.jsonWriteOptions = exports.jsonReadOptions = undefined;
@@ -910,14 +910,14 @@ var require_json_format_contract = __commonJS((exports) => {
910
910
  exports.mergeJsonOptions = mergeJsonOptions;
911
911
  });
912
912
 
913
- // ../../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/message-type-contract.js
913
+ // ../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/message-type-contract.js
914
914
  var require_message_type_contract = __commonJS((exports) => {
915
915
  Object.defineProperty(exports, "__esModule", { value: true });
916
916
  exports.MESSAGE_TYPE = undefined;
917
917
  exports.MESSAGE_TYPE = Symbol.for("protobuf-ts/message-type");
918
918
  });
919
919
 
920
- // ../../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/lower-camel-case.js
920
+ // ../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/lower-camel-case.js
921
921
  var require_lower_camel_case = __commonJS((exports) => {
922
922
  Object.defineProperty(exports, "__esModule", { value: true });
923
923
  exports.lowerCamelCase = undefined;
@@ -945,7 +945,7 @@ var require_lower_camel_case = __commonJS((exports) => {
945
945
  exports.lowerCamelCase = lowerCamelCase;
946
946
  });
947
947
 
948
- // ../../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/reflection-info.js
948
+ // ../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/reflection-info.js
949
949
  var require_reflection_info = __commonJS((exports) => {
950
950
  Object.defineProperty(exports, "__esModule", { value: true });
951
951
  exports.readMessageOption = exports.readFieldOption = exports.readFieldOptions = exports.normalizeFieldInfo = exports.RepeatType = exports.LongType = exports.ScalarType = undefined;
@@ -1019,7 +1019,7 @@ var require_reflection_info = __commonJS((exports) => {
1019
1019
  exports.readMessageOption = readMessageOption;
1020
1020
  });
1021
1021
 
1022
- // ../../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/oneof.js
1022
+ // ../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/oneof.js
1023
1023
  var require_oneof = __commonJS((exports) => {
1024
1024
  Object.defineProperty(exports, "__esModule", { value: true });
1025
1025
  exports.getSelectedOneofValue = exports.clearOneofValue = exports.setUnknownOneofValue = exports.setOneofValue = exports.getOneofValue = exports.isOneofGroup = undefined;
@@ -1079,7 +1079,7 @@ var require_oneof = __commonJS((exports) => {
1079
1079
  exports.getSelectedOneofValue = getSelectedOneofValue;
1080
1080
  });
1081
1081
 
1082
- // ../../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/reflection-type-check.js
1082
+ // ../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/reflection-type-check.js
1083
1083
  var require_reflection_type_check = __commonJS((exports) => {
1084
1084
  Object.defineProperty(exports, "__esModule", { value: true });
1085
1085
  exports.ReflectionTypeCheck = undefined;
@@ -1280,7 +1280,7 @@ var require_reflection_type_check = __commonJS((exports) => {
1280
1280
  exports.ReflectionTypeCheck = ReflectionTypeCheck;
1281
1281
  });
1282
1282
 
1283
- // ../../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/reflection-long-convert.js
1283
+ // ../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/reflection-long-convert.js
1284
1284
  var require_reflection_long_convert = __commonJS((exports) => {
1285
1285
  Object.defineProperty(exports, "__esModule", { value: true });
1286
1286
  exports.reflectionLongConvert = undefined;
@@ -1298,7 +1298,7 @@ var require_reflection_long_convert = __commonJS((exports) => {
1298
1298
  exports.reflectionLongConvert = reflectionLongConvert;
1299
1299
  });
1300
1300
 
1301
- // ../../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/reflection-json-reader.js
1301
+ // ../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/reflection-json-reader.js
1302
1302
  var require_reflection_json_reader = __commonJS((exports) => {
1303
1303
  Object.defineProperty(exports, "__esModule", { value: true });
1304
1304
  exports.ReflectionJsonReader = undefined;
@@ -1572,7 +1572,7 @@ var require_reflection_json_reader = __commonJS((exports) => {
1572
1572
  exports.ReflectionJsonReader = ReflectionJsonReader;
1573
1573
  });
1574
1574
 
1575
- // ../../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/reflection-json-writer.js
1575
+ // ../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/reflection-json-writer.js
1576
1576
  var require_reflection_json_writer = __commonJS((exports) => {
1577
1577
  Object.defineProperty(exports, "__esModule", { value: true });
1578
1578
  exports.ReflectionJsonWriter = undefined;
@@ -1775,7 +1775,7 @@ var require_reflection_json_writer = __commonJS((exports) => {
1775
1775
  exports.ReflectionJsonWriter = ReflectionJsonWriter;
1776
1776
  });
1777
1777
 
1778
- // ../../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/reflection-scalar-default.js
1778
+ // ../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/reflection-scalar-default.js
1779
1779
  var require_reflection_scalar_default = __commonJS((exports) => {
1780
1780
  Object.defineProperty(exports, "__esModule", { value: true });
1781
1781
  exports.reflectionScalarDefault = undefined;
@@ -1807,7 +1807,7 @@ var require_reflection_scalar_default = __commonJS((exports) => {
1807
1807
  exports.reflectionScalarDefault = reflectionScalarDefault;
1808
1808
  });
1809
1809
 
1810
- // ../../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/reflection-binary-reader.js
1810
+ // ../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/reflection-binary-reader.js
1811
1811
  var require_reflection_binary_reader = __commonJS((exports) => {
1812
1812
  Object.defineProperty(exports, "__esModule", { value: true });
1813
1813
  exports.ReflectionBinaryReader = undefined;
@@ -1967,7 +1967,7 @@ var require_reflection_binary_reader = __commonJS((exports) => {
1967
1967
  exports.ReflectionBinaryReader = ReflectionBinaryReader;
1968
1968
  });
1969
1969
 
1970
- // ../../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/reflection-binary-writer.js
1970
+ // ../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/reflection-binary-writer.js
1971
1971
  var require_reflection_binary_writer = __commonJS((exports) => {
1972
1972
  Object.defineProperty(exports, "__esModule", { value: true });
1973
1973
  exports.ReflectionBinaryWriter = undefined;
@@ -2165,7 +2165,7 @@ var require_reflection_binary_writer = __commonJS((exports) => {
2165
2165
  exports.ReflectionBinaryWriter = ReflectionBinaryWriter;
2166
2166
  });
2167
2167
 
2168
- // ../../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/reflection-create.js
2168
+ // ../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/reflection-create.js
2169
2169
  var require_reflection_create = __commonJS((exports) => {
2170
2170
  Object.defineProperty(exports, "__esModule", { value: true });
2171
2171
  exports.reflectionCreate = undefined;
@@ -2199,7 +2199,7 @@ var require_reflection_create = __commonJS((exports) => {
2199
2199
  exports.reflectionCreate = reflectionCreate;
2200
2200
  });
2201
2201
 
2202
- // ../../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/reflection-merge-partial.js
2202
+ // ../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/reflection-merge-partial.js
2203
2203
  var require_reflection_merge_partial = __commonJS((exports) => {
2204
2204
  Object.defineProperty(exports, "__esModule", { value: true });
2205
2205
  exports.reflectionMergePartial = undefined;
@@ -2266,7 +2266,7 @@ var require_reflection_merge_partial = __commonJS((exports) => {
2266
2266
  exports.reflectionMergePartial = reflectionMergePartial;
2267
2267
  });
2268
2268
 
2269
- // ../../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/reflection-equals.js
2269
+ // ../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/reflection-equals.js
2270
2270
  var require_reflection_equals = __commonJS((exports) => {
2271
2271
  Object.defineProperty(exports, "__esModule", { value: true });
2272
2272
  exports.reflectionEquals = undefined;
@@ -2334,7 +2334,7 @@ var require_reflection_equals = __commonJS((exports) => {
2334
2334
  }
2335
2335
  });
2336
2336
 
2337
- // ../../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/message-type.js
2337
+ // ../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/message-type.js
2338
2338
  var require_message_type = __commonJS((exports) => {
2339
2339
  Object.defineProperty(exports, "__esModule", { value: true });
2340
2340
  exports.MessageType = undefined;
@@ -2440,7 +2440,7 @@ var require_message_type = __commonJS((exports) => {
2440
2440
  exports.MessageType = MessageType;
2441
2441
  });
2442
2442
 
2443
- // ../../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/reflection-contains-message-type.js
2443
+ // ../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/reflection-contains-message-type.js
2444
2444
  var require_reflection_contains_message_type = __commonJS((exports) => {
2445
2445
  Object.defineProperty(exports, "__esModule", { value: true });
2446
2446
  exports.containsMessageType = undefined;
@@ -2451,7 +2451,7 @@ var require_reflection_contains_message_type = __commonJS((exports) => {
2451
2451
  exports.containsMessageType = containsMessageType;
2452
2452
  });
2453
2453
 
2454
- // ../../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/enum-object.js
2454
+ // ../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/enum-object.js
2455
2455
  var require_enum_object = __commonJS((exports) => {
2456
2456
  Object.defineProperty(exports, "__esModule", { value: true });
2457
2457
  exports.listEnumNumbers = exports.listEnumNames = exports.listEnumValues = exports.isEnumObject = undefined;
@@ -2503,7 +2503,7 @@ var require_enum_object = __commonJS((exports) => {
2503
2503
  exports.listEnumNumbers = listEnumNumbers;
2504
2504
  });
2505
2505
 
2506
- // ../../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/index.js
2506
+ // ../node_modules/.bun/@protobuf-ts+runtime@2.11.1/node_modules/@protobuf-ts/runtime/build/commonjs/index.js
2507
2507
  var require_commonjs = __commonJS((exports) => {
2508
2508
  Object.defineProperty(exports, "__esModule", { value: true });
2509
2509
  var json_typings_1 = require_json_typings();
@@ -2686,7 +2686,7 @@ var require_commonjs = __commonJS((exports) => {
2686
2686
  } });
2687
2687
  });
2688
2688
 
2689
- // ../../node_modules/.bun/ws@8.21.0/node_modules/ws/lib/constants.js
2689
+ // ../node_modules/.bun/ws@8.21.0/node_modules/ws/lib/constants.js
2690
2690
  var require_constants = __commonJS((exports, module) => {
2691
2691
  var BINARY_TYPES = ["nodebuffer", "arraybuffer", "fragments"];
2692
2692
  var hasBlob = typeof Blob !== "undefined";
@@ -2706,7 +2706,7 @@ var require_constants = __commonJS((exports, module) => {
2706
2706
  };
2707
2707
  });
2708
2708
 
2709
- // ../../node_modules/.bun/ws@8.21.0/node_modules/ws/lib/buffer-util.js
2709
+ // ../node_modules/.bun/ws@8.21.0/node_modules/ws/lib/buffer-util.js
2710
2710
  var require_buffer_util = __commonJS((exports, module) => {
2711
2711
  var { EMPTY_BUFFER } = require_constants();
2712
2712
  var FastBuffer = Buffer[Symbol.species];
@@ -2784,7 +2784,7 @@ var require_buffer_util = __commonJS((exports, module) => {
2784
2784
  }
2785
2785
  });
2786
2786
 
2787
- // ../../node_modules/.bun/ws@8.21.0/node_modules/ws/lib/limiter.js
2787
+ // ../node_modules/.bun/ws@8.21.0/node_modules/ws/lib/limiter.js
2788
2788
  var require_limiter = __commonJS((exports, module) => {
2789
2789
  var kDone = Symbol("kDone");
2790
2790
  var kRun = Symbol("kRun");
@@ -2816,7 +2816,7 @@ var require_limiter = __commonJS((exports, module) => {
2816
2816
  module.exports = Limiter;
2817
2817
  });
2818
2818
 
2819
- // ../../node_modules/.bun/ws@8.21.0/node_modules/ws/lib/permessage-deflate.js
2819
+ // ../node_modules/.bun/ws@8.21.0/node_modules/ws/lib/permessage-deflate.js
2820
2820
  var require_permessage_deflate = __commonJS((exports, module) => {
2821
2821
  var zlib = __require("zlib");
2822
2822
  var bufferUtil = require_buffer_util();
@@ -3080,7 +3080,7 @@ var require_permessage_deflate = __commonJS((exports, module) => {
3080
3080
  }
3081
3081
  });
3082
3082
 
3083
- // ../../node_modules/.bun/ws@8.21.0/node_modules/ws/lib/validation.js
3083
+ // ../node_modules/.bun/ws@8.21.0/node_modules/ws/lib/validation.js
3084
3084
  var require_validation = __commonJS((exports, module) => {
3085
3085
  var { isUtf8 } = __require("buffer");
3086
3086
  var { hasBlob } = require_constants();
@@ -3267,7 +3267,7 @@ var require_validation = __commonJS((exports, module) => {
3267
3267
  }
3268
3268
  });
3269
3269
 
3270
- // ../../node_modules/.bun/ws@8.21.0/node_modules/ws/lib/receiver.js
3270
+ // ../node_modules/.bun/ws@8.21.0/node_modules/ws/lib/receiver.js
3271
3271
  var require_receiver = __commonJS((exports, module) => {
3272
3272
  var { Writable } = __require("stream");
3273
3273
  var PerMessageDeflate = require_permessage_deflate();
@@ -3664,7 +3664,7 @@ var require_receiver = __commonJS((exports, module) => {
3664
3664
  module.exports = Receiver;
3665
3665
  });
3666
3666
 
3667
- // ../../node_modules/.bun/ws@8.21.0/node_modules/ws/lib/sender.js
3667
+ // ../node_modules/.bun/ws@8.21.0/node_modules/ws/lib/sender.js
3668
3668
  var require_sender = __commonJS((exports, module) => {
3669
3669
  var { Duplex } = __require("stream");
3670
3670
  var { randomFillSync } = __require("crypto");
@@ -4023,7 +4023,7 @@ var require_sender = __commonJS((exports, module) => {
4023
4023
  }
4024
4024
  });
4025
4025
 
4026
- // ../../node_modules/.bun/ws@8.21.0/node_modules/ws/lib/event-target.js
4026
+ // ../node_modules/.bun/ws@8.21.0/node_modules/ws/lib/event-target.js
4027
4027
  var require_event_target = __commonJS((exports, module) => {
4028
4028
  var { kForOnEventAttribute, kListener } = require_constants();
4029
4029
  var kCode = Symbol("kCode");
@@ -4174,7 +4174,7 @@ var require_event_target = __commonJS((exports, module) => {
4174
4174
  }
4175
4175
  });
4176
4176
 
4177
- // ../../node_modules/.bun/ws@8.21.0/node_modules/ws/lib/extension.js
4177
+ // ../node_modules/.bun/ws@8.21.0/node_modules/ws/lib/extension.js
4178
4178
  var require_extension = __commonJS((exports, module) => {
4179
4179
  var { tokenChars } = require_validation();
4180
4180
  function push(dest, name, elem) {
@@ -4339,7 +4339,7 @@ var require_extension = __commonJS((exports, module) => {
4339
4339
  module.exports = { format, parse };
4340
4340
  });
4341
4341
 
4342
- // ../../node_modules/.bun/ws@8.21.0/node_modules/ws/lib/websocket.js
4342
+ // ../node_modules/.bun/ws@8.21.0/node_modules/ws/lib/websocket.js
4343
4343
  var require_websocket = __commonJS((exports, module) => {
4344
4344
  var EventEmitter = __require("events");
4345
4345
  var https = __require("https");
@@ -5111,7 +5111,7 @@ var require_websocket = __commonJS((exports, module) => {
5111
5111
  }
5112
5112
  });
5113
5113
 
5114
- // ../../node_modules/.bun/ws@8.21.0/node_modules/ws/lib/stream.js
5114
+ // ../node_modules/.bun/ws@8.21.0/node_modules/ws/lib/stream.js
5115
5115
  var require_stream = __commonJS((exports, module) => {
5116
5116
  var WebSocket = require_websocket();
5117
5117
  var { Duplex } = __require("stream");
@@ -5214,7 +5214,7 @@ var require_stream = __commonJS((exports, module) => {
5214
5214
  module.exports = createWebSocketStream;
5215
5215
  });
5216
5216
 
5217
- // ../../node_modules/.bun/ws@8.21.0/node_modules/ws/lib/subprotocol.js
5217
+ // ../node_modules/.bun/ws@8.21.0/node_modules/ws/lib/subprotocol.js
5218
5218
  var require_subprotocol = __commonJS((exports, module) => {
5219
5219
  var { tokenChars } = require_validation();
5220
5220
  function parse(header) {
@@ -5259,7 +5259,7 @@ var require_subprotocol = __commonJS((exports, module) => {
5259
5259
  module.exports = { parse };
5260
5260
  });
5261
5261
 
5262
- // ../../node_modules/.bun/ws@8.21.0/node_modules/ws/lib/websocket-server.js
5262
+ // ../node_modules/.bun/ws@8.21.0/node_modules/ws/lib/websocket-server.js
5263
5263
  var require_websocket_server = __commonJS((exports, module) => {
5264
5264
  var EventEmitter = __require("events");
5265
5265
  var http = __require("http");
@@ -5576,7 +5576,7 @@ import { timingSafeEqual } from "node:crypto";
5576
5576
  import { mkdir, readFile as readFile2, stat } from "node:fs/promises";
5577
5577
  import path from "node:path";
5578
5578
 
5579
- // ../protocol/dist/core.js
5579
+ // ../packages/protocol/dist/core.js
5580
5580
  var import_runtime = __toESM(require_commonjs(), 1);
5581
5581
  var import_runtime2 = __toESM(require_commonjs(), 1);
5582
5582
  var import_runtime3 = __toESM(require_commonjs(), 1);
@@ -22118,7 +22118,7 @@ function describeConnectionError(error) {
22118
22118
  return `server connection error${suffix}: ${message}`;
22119
22119
  }
22120
22120
 
22121
- // ../../node_modules/.bun/ws@8.21.0/node_modules/ws/wrapper.mjs
22121
+ // ../node_modules/.bun/ws@8.21.0/node_modules/ws/wrapper.mjs
22122
22122
  var import_stream = __toESM(require_stream(), 1);
22123
22123
  var import_extension = __toESM(require_extension(), 1);
22124
22124
  var import_permessage_deflate = __toESM(require_permessage_deflate(), 1);
@@ -22160,6 +22160,7 @@ class WebSocketTransport {
22160
22160
  lastReconnectDelayMs = null;
22161
22161
  lastReconnectCause = null;
22162
22162
  reconnectCount = 0;
22163
+ reconnectScheduling = false;
22163
22164
  constructor(options) {
22164
22165
  this.url = options.url;
22165
22166
  this.log = options.logger ?? {};
@@ -22187,26 +22188,33 @@ class WebSocketTransport {
22187
22188
  }
22188
22189
  async reconnect(options) {
22189
22190
  const skipDelay = options?.skipDelay ?? false;
22190
- if (this.state === "connecting" && this.reconnectionTimer) {
22191
+ if (this.state === "connecting" && (this.reconnectionTimer || this.reconnectScheduling)) {
22191
22192
  return;
22192
22193
  }
22193
- await this.setConnecting();
22194
- this.cleanUpPreviousConnection();
22195
- this.connectionAttemptNo = this.connectionAttemptNo + 1 >>> 0;
22196
- const delaySeconds = this.getReconnectionDelaySeconds(this.connectionAttemptNo);
22197
- const delayMs = Math.round(delaySeconds * 1000);
22198
- const cause = options?.cause?.trim() || "unspecified";
22199
- this.lastReconnectScheduledAt = Date.now();
22200
- this.lastReconnectDelayMs = delayMs;
22201
- this.lastReconnectCause = cause;
22202
- this.reconnectCount += 1;
22203
- this.log.warn?.(`WebSocket reconnect scheduled (attempt=${this.connectionAttemptNo}, delayMs=${delayMs}, cause=${cause})`);
22204
- this.reconnectionTimer = setTimeout(() => {
22205
- this.reconnectionTimer = null;
22206
- if (this.state === "idle" || this.state === "connected")
22194
+ this.reconnectScheduling = true;
22195
+ try {
22196
+ await this.setConnecting();
22197
+ if (this.state === "idle" || this.reconnectionTimer)
22207
22198
  return;
22208
- this.openConnection();
22209
- }, skipDelay ? 0 : delaySeconds * 1000);
22199
+ this.cleanUpPreviousConnection();
22200
+ this.connectionAttemptNo = this.connectionAttemptNo + 1 >>> 0;
22201
+ const delaySeconds = this.getReconnectionDelaySeconds(this.connectionAttemptNo);
22202
+ const delayMs = Math.round(delaySeconds * 1000);
22203
+ const cause = options?.cause?.trim() || "unspecified";
22204
+ this.lastReconnectScheduledAt = Date.now();
22205
+ this.lastReconnectDelayMs = delayMs;
22206
+ this.lastReconnectCause = cause;
22207
+ this.reconnectCount += 1;
22208
+ this.log.warn?.(`WebSocket reconnect scheduled (attempt=${this.connectionAttemptNo}, delayMs=${delayMs}, cause=${cause})`);
22209
+ this.reconnectionTimer = setTimeout(() => {
22210
+ this.reconnectionTimer = null;
22211
+ if (this.state === "idle" || this.state === "connected")
22212
+ return;
22213
+ this.openConnection();
22214
+ }, skipDelay ? 0 : delaySeconds * 1000);
22215
+ } finally {
22216
+ this.reconnectScheduling = false;
22217
+ }
22210
22218
  }
22211
22219
  cleanUpPreviousConnection() {
22212
22220
  if (this.reconnectionTimer) {
@@ -22676,6 +22684,7 @@ class InlineSdkClient {
22676
22684
  const chat = result.getChat.chat;
22677
22685
  if (!chat)
22678
22686
  throw new Error("getChat: missing chat");
22687
+ const dialogFollowMode = result.getChat.dialog?.followMode;
22679
22688
  return {
22680
22689
  chatId: chat.id,
22681
22690
  title: chat.title,
@@ -22683,6 +22692,8 @@ class InlineSdkClient {
22683
22692
  ...chat.spaceId != null ? { spaceId: chat.spaceId } : {},
22684
22693
  ...chat.parentChatId != null ? { parentChatId: chat.parentChatId } : {},
22685
22694
  ...chat.parentMessageId != null ? { parentMessageId: chat.parentMessageId } : {},
22695
+ ...chat.lastMsgId != null ? { lastMsgId: chat.lastMsgId } : {},
22696
+ ...dialogFollowMode != null ? { dialogFollowMode } : {},
22686
22697
  ...chat.isPublic != null ? { isPublic: chat.isPublic } : {},
22687
22698
  ...chat.untitled != null ? { untitled: chat.untitled } : {},
22688
22699
  ...chat.number != null ? { number: chat.number } : {}
@@ -23799,6 +23810,36 @@ var resolveUploadFileUrl = (baseUrl) => {
23799
23810
  return url;
23800
23811
  };
23801
23812
  var hasMethodMapping = (method) => Object.prototype.hasOwnProperty.call(rpcInputKindByMethod, method) && Object.prototype.hasOwnProperty.call(rpcResultKindByMethod, method);
23813
+ // ../sdk/dist/sdk/thread-mention-gating.js
23814
+ var INLINE_FOLLOW_MODE_MENTION_FRESH_LAST_MESSAGE_ID_LIMIT = 50;
23815
+ function isInlineReplyThreadForMentionGate(chat) {
23816
+ return parsePositiveInteger(chat.parentMessageId) != null;
23817
+ }
23818
+ function isInlineFreshThreadForMentionGate(lastMsgId, limit = INLINE_FOLLOW_MODE_MENTION_FRESH_LAST_MESSAGE_ID_LIMIT) {
23819
+ const normalized = parsePositiveInteger(lastMsgId);
23820
+ return normalized != null && normalized < BigInt(limit);
23821
+ }
23822
+ function isInlineFollowModeMentionGateEligible(chat) {
23823
+ if (isInlineReplyThreadForMentionGate(chat)) {
23824
+ return true;
23825
+ }
23826
+ return isInlineFreshThreadForMentionGate(chat.lastMsgId);
23827
+ }
23828
+ function parsePositiveInteger(value) {
23829
+ if (value == null)
23830
+ return null;
23831
+ if (typeof value === "bigint")
23832
+ return value > 0n ? value : null;
23833
+ if (typeof value === "number") {
23834
+ if (!Number.isSafeInteger(value) || value <= 0)
23835
+ return null;
23836
+ return BigInt(value);
23837
+ }
23838
+ const text = value.trim();
23839
+ if (!/^[1-9]\d*$/.test(text))
23840
+ return null;
23841
+ return BigInt(text);
23842
+ }
23802
23843
  // ../sdk/dist/state/json-file-state-store.js
23803
23844
  import { readFile, rename, writeFile } from "node:fs/promises";
23804
23845
 
@@ -24275,6 +24316,21 @@ async function handleRequest(req, res) {
24275
24316
  case "/history":
24276
24317
  await endpointHistory(res, body);
24277
24318
  return;
24319
+ case "/search":
24320
+ await endpointSearch(res, body);
24321
+ return;
24322
+ case "/reaction":
24323
+ await endpointReaction(res, body);
24324
+ return;
24325
+ case "/reactions":
24326
+ await endpointReactions(res, body);
24327
+ return;
24328
+ case "/pin":
24329
+ await endpointPin(res, body);
24330
+ return;
24331
+ case "/pins":
24332
+ await endpointPins(res, body);
24333
+ return;
24278
24334
  case "/create-subthread":
24279
24335
  await endpointCreateSubthread(res, body);
24280
24336
  return;
@@ -24441,19 +24497,31 @@ async function endpointChat(res, body) {
24441
24497
  });
24442
24498
  return;
24443
24499
  }
24444
- const chat = await client.getChat({ chatId: target.chatId });
24500
+ const snapshot = await getRawChatSnapshot(target.chatId);
24501
+ const chat = snapshot.chat;
24502
+ const followModeMentionEligible = isInlineFollowModeMentionGateEligible(chat);
24445
24503
  writeJson(res, 200, {
24446
24504
  ok: true,
24447
24505
  result: {
24448
- chatId: chat.chatId.toString(),
24449
- title: chat.title,
24450
- ...chat.peer != null ? { peer: safeJson(chat.peer) } : {},
24506
+ chatId: chat.id?.toString() ?? target.chatId.toString(),
24507
+ title: chat.title ?? "",
24508
+ ...chat.peerId != null ? { peer: safeJson(chat.peerId) } : {},
24451
24509
  ...chat.spaceId != null ? { spaceId: chat.spaceId.toString() } : {},
24452
24510
  ...chat.parentChatId != null ? { parentChatId: chat.parentChatId.toString() } : {},
24453
24511
  ...chat.parentMessageId != null ? { parentMessageId: chat.parentMessageId.toString() } : {},
24512
+ ...chat.description != null ? { description: chat.description } : {},
24513
+ ...chat.emoji != null ? { emoji: chat.emoji } : {},
24454
24514
  ...chat.isPublic != null ? { isPublic: chat.isPublic } : {},
24515
+ ...chat.lastMsgId != null ? { lastMsgId: chat.lastMsgId.toString() } : {},
24516
+ ...chat.date != null ? { date: chat.date.toString() } : {},
24517
+ ...chat.createdBy != null ? { createdBy: chat.createdBy.toString() } : {},
24455
24518
  ...chat.untitled != null ? { untitled: chat.untitled } : {},
24456
24519
  ...chat.number != null ? { number: chat.number } : {},
24520
+ ...snapshot.dialog != null ? { dialog: safeJson(snapshot.dialog) } : {},
24521
+ ...snapshot.dialogFollowMode != null ? { dialogFollowMode: String(snapshot.dialogFollowMode) } : {},
24522
+ followModeMentionEligible,
24523
+ pinnedMessageIds: safeJson(snapshot.pinnedMessageIds),
24524
+ ...snapshot.anchorMessage != null ? { anchorMessage: safeJson(snapshot.anchorMessage) } : {},
24457
24525
  chat: safeJson(chat)
24458
24526
  }
24459
24527
  });
@@ -24482,6 +24550,100 @@ async function endpointHistory(res, body) {
24482
24550
  const history = result;
24483
24551
  writeJson(res, 200, { ok: true, result: { messages: safeJson(history.getChatHistory?.messages ?? []) } });
24484
24552
  }
24553
+ async function endpointSearch(res, body) {
24554
+ const record = asRecord(body);
24555
+ const target = parseTarget(record);
24556
+ const query = readRequiredString(record, "query").trim();
24557
+ if (!query)
24558
+ throw new SidecarError("search requires query", "bad_format");
24559
+ const limit = clampResultLimit(readOptionalNumber(record, "limit") ?? 20, 100);
24560
+ const offsetId = readOptionalString(record, "offsetId");
24561
+ const result = await client.invokeUncheckedRaw(Method.SEARCH_MESSAGES, {
24562
+ oneofKind: "searchMessages",
24563
+ searchMessages: {
24564
+ peerId: inputPeerFromTarget(target),
24565
+ queries: [query],
24566
+ limit,
24567
+ ...offsetId ? { offsetId: BigInt(offsetId) } : {}
24568
+ }
24569
+ });
24570
+ const typed = result;
24571
+ writeJson(res, 200, { ok: true, result: { messages: safeJson(typed.searchMessages?.messages ?? []) } });
24572
+ }
24573
+ async function endpointReaction(res, body) {
24574
+ const record = asRecord(body);
24575
+ const target = parseTarget(record);
24576
+ const messageId = readRequiredString(record, "messageId");
24577
+ const emoji = readRequiredString(record, "emoji").trim();
24578
+ if (!emoji)
24579
+ throw new SidecarError("reaction requires emoji", "bad_format");
24580
+ const remove = readOptionalBoolean(record, "remove") ?? false;
24581
+ if (remove) {
24582
+ await client.invokeUncheckedRaw(Method.DELETE_REACTION, {
24583
+ oneofKind: "deleteReaction",
24584
+ deleteReaction: {
24585
+ emoji,
24586
+ peerId: inputPeerFromTarget(target),
24587
+ messageId: BigInt(messageId)
24588
+ }
24589
+ });
24590
+ } else {
24591
+ await client.invokeUncheckedRaw(Method.ADD_REACTION, {
24592
+ oneofKind: "addReaction",
24593
+ addReaction: {
24594
+ emoji,
24595
+ messageId: BigInt(messageId),
24596
+ peerId: inputPeerFromTarget(target)
24597
+ }
24598
+ });
24599
+ }
24600
+ writeJson(res, 200, { ok: true, result: { messageId, emoji, removed: remove } });
24601
+ }
24602
+ async function endpointReactions(res, body) {
24603
+ const record = asRecord(body);
24604
+ const target = parseTarget(record);
24605
+ const messageId = readRequiredString(record, "messageId");
24606
+ const result = "chatId" in target ? await client.getMessages({ chatId: target.chatId, messageIds: [BigInt(messageId)] }) : await client.getMessages({ userId: target.userId, messageIds: [BigInt(messageId)] });
24607
+ const message = result.messages[0] ?? null;
24608
+ writeJson(res, 200, {
24609
+ ok: true,
24610
+ result: {
24611
+ message: safeJson(message),
24612
+ reactions: safeJson(reactionsFromMessage(message))
24613
+ }
24614
+ });
24615
+ }
24616
+ async function endpointPin(res, body) {
24617
+ const record = asRecord(body);
24618
+ const target = parseTarget(record);
24619
+ const messageId = readRequiredString(record, "messageId");
24620
+ const unpin = readOptionalBoolean(record, "unpin") ?? false;
24621
+ await client.invokeUncheckedRaw(Method.PIN_MESSAGE, {
24622
+ oneofKind: "pinMessage",
24623
+ pinMessage: {
24624
+ peerId: inputPeerFromTarget(target),
24625
+ messageId: BigInt(messageId),
24626
+ unpin
24627
+ }
24628
+ });
24629
+ writeJson(res, 200, { ok: true, result: { messageId, unpinned: unpin } });
24630
+ }
24631
+ async function endpointPins(res, body) {
24632
+ const record = asRecord(body);
24633
+ const target = parseTarget(record);
24634
+ if ("userId" in target) {
24635
+ throw new SidecarError("pins requires a chat target", "bad_format");
24636
+ }
24637
+ const snapshot = await getRawChatSnapshot(target.chatId);
24638
+ writeJson(res, 200, {
24639
+ ok: true,
24640
+ result: {
24641
+ chatId: target.chatId.toString(),
24642
+ pinnedMessageIds: safeJson(snapshot.pinnedMessageIds),
24643
+ ...snapshot.anchorMessage != null ? { anchorMessage: safeJson(snapshot.anchorMessage) } : {}
24644
+ }
24645
+ });
24646
+ }
24485
24647
  async function endpointCreateSubthread(res, body) {
24486
24648
  const record = asRecord(body);
24487
24649
  const parentChatId = readRequiredString(record, "parentChatId");
@@ -24510,6 +24672,36 @@ async function endpointCreateSubthread(res, body) {
24510
24672
  }
24511
24673
  });
24512
24674
  }
24675
+ async function getRawChatSnapshot(chatId) {
24676
+ const result = await client.invoke(Method.GET_CHAT, {
24677
+ oneofKind: "getChat",
24678
+ getChat: GetChatInput.create({ peerId: inputPeerFromTarget({ chatId }) })
24679
+ });
24680
+ const typed = result;
24681
+ const chat = typed.getChat?.chat;
24682
+ if (!chat)
24683
+ throw new SidecarError("chat not found", "not_found");
24684
+ const dialog = typed.getChat?.dialog;
24685
+ const dialogFollowMode = dialog?.followMode ?? dialog?.follow_mode ?? undefined;
24686
+ return {
24687
+ chat,
24688
+ ...dialog != null ? { dialog } : {},
24689
+ ...dialogFollowMode != null ? { dialogFollowMode } : {},
24690
+ pinnedMessageIds: typed.getChat?.pinnedMessageIds ?? [],
24691
+ ...typed.getChat?.anchorMessage != null ? { anchorMessage: typed.getChat.anchorMessage } : {}
24692
+ };
24693
+ }
24694
+ function reactionsFromMessage(message) {
24695
+ if (!message || typeof message !== "object" || !("reactions" in message))
24696
+ return null;
24697
+ return message.reactions ?? null;
24698
+ }
24699
+ function clampResultLimit(value, max) {
24700
+ if (!Number.isInteger(value) || value < 1) {
24701
+ throw new SidecarError("limit must be a positive integer", "bad_format");
24702
+ }
24703
+ return Math.min(value, max);
24704
+ }
24513
24705
  async function endpointAnswerAction(res, body) {
24514
24706
  const record = asRecord(body);
24515
24707
  const interactionId = readRequiredString(record, "interactionId");
@@ -24624,6 +24816,8 @@ class MockInlineClient {
24624
24816
  title: "Mock reply thread 456",
24625
24817
  parentChatId: 123n,
24626
24818
  parentMessageId: 9001n,
24819
+ lastMsgId: 9002n,
24820
+ dialogFollowMode: 1,
24627
24821
  untitled: true
24628
24822
  };
24629
24823
  }
@@ -24638,7 +24832,16 @@ class MockInlineClient {
24638
24832
  chatId: "chatId" in params ? BigInt(params.chatId) : undefined,
24639
24833
  peerId: "chatId" in params ? { type: { oneofKind: "chat", chat: { chatId: BigInt(params.chatId) } } } : { type: { oneofKind: "user", user: { userId: BigInt(params.userId) } } },
24640
24834
  message: `mock message ${id.toString()}`,
24641
- date: 123n
24835
+ date: 123n,
24836
+ reactions: {
24837
+ reactions: [{
24838
+ emoji: "ok",
24839
+ userId: 222n,
24840
+ messageId: BigInt(id),
24841
+ chatId: "chatId" in params ? BigInt(params.chatId) : 0n,
24842
+ date: 125n
24843
+ }]
24844
+ }
24642
24845
  }))
24643
24846
  };
24644
24847
  }
@@ -24673,6 +24876,36 @@ class MockInlineClient {
24673
24876
  }
24674
24877
  async invoke(method, input) {
24675
24878
  this.record(`invoke:${methodName(method)}`, input);
24879
+ if (method === Method.GET_CHAT) {
24880
+ const inputRecord = asOptionalRecord(input);
24881
+ const getChat = asOptionalRecord(inputRecord?.getChat);
24882
+ const chatId = chatIdFromInputPeer(getChat?.peerId) ?? 123n;
24883
+ const chat = chatId === 456n ? {
24884
+ id: chatId,
24885
+ title: "Mock reply thread 456",
24886
+ parentChatId: 123n,
24887
+ parentMessageId: 9001n,
24888
+ lastMsgId: 9002n,
24889
+ untitled: true
24890
+ } : {
24891
+ id: chatId,
24892
+ title: `Mock chat ${chatId.toString()}`
24893
+ };
24894
+ return {
24895
+ getChat: {
24896
+ chat,
24897
+ dialog: { chatId, followMode: chatId === 456n ? 1 : 0 },
24898
+ pinnedMessageIds: [8801n],
24899
+ anchorMessage: {
24900
+ id: 8801n,
24901
+ fromId: 111n,
24902
+ chatId,
24903
+ message: "mock pinned message",
24904
+ date: 126n
24905
+ }
24906
+ }
24907
+ };
24908
+ }
24676
24909
  if (method === Method.GET_CHAT_HISTORY) {
24677
24910
  return {
24678
24911
  getChatHistory: {
@@ -24702,6 +24935,35 @@ class MockInlineClient {
24702
24935
  }
24703
24936
  };
24704
24937
  }
24938
+ if (method === Method.SEARCH_MESSAGES) {
24939
+ const inputRecord = asOptionalRecord(input);
24940
+ const searchMessages = asOptionalRecord(inputRecord?.searchMessages);
24941
+ const peerId = searchMessages?.peerId;
24942
+ const chatId = chatIdFromInputPeer(peerId) ?? 123n;
24943
+ const queries = Array.isArray(searchMessages?.queries) ? searchMessages.queries : [];
24944
+ return {
24945
+ oneofKind: "searchMessages",
24946
+ searchMessages: {
24947
+ messages: [{
24948
+ id: 8802n,
24949
+ fromId: 111n,
24950
+ chatId,
24951
+ peerId,
24952
+ message: `mock search ${String(queries[0] ?? "")}`.trim(),
24953
+ date: 127n
24954
+ }]
24955
+ }
24956
+ };
24957
+ }
24958
+ if (method === Method.ADD_REACTION) {
24959
+ return { oneofKind: "addReaction", addReaction: { updates: [] } };
24960
+ }
24961
+ if (method === Method.DELETE_REACTION) {
24962
+ return { oneofKind: "deleteReaction", deleteReaction: { updates: [] } };
24963
+ }
24964
+ if (method === Method.PIN_MESSAGE) {
24965
+ return { oneofKind: "pinMessage", pinMessage: { updates: [] } };
24966
+ }
24705
24967
  return { oneofKind: undefined };
24706
24968
  }
24707
24969
  record(method, params) {
@@ -24717,6 +24979,21 @@ function binarySize(value) {
24717
24979
  return value.size;
24718
24980
  return null;
24719
24981
  }
24982
+ function chatIdFromInputPeer(peer) {
24983
+ const inputPeer = asOptionalRecord(peer);
24984
+ const type = asOptionalRecord(inputPeer?.type);
24985
+ if (type?.oneofKind !== "chat")
24986
+ return null;
24987
+ const chat = asOptionalRecord(type.chat);
24988
+ const chatId = chat?.chatId;
24989
+ if (chatId == null)
24990
+ return null;
24991
+ try {
24992
+ return BigInt(String(chatId));
24993
+ } catch {
24994
+ return null;
24995
+ }
24996
+ }
24720
24997
  function methodName(method) {
24721
24998
  return Method[method] ?? String(method);
24722
24999
  }