@inline-chat/hermes-agent-adapter 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -8
- package/dist/install.js +72 -72
- package/package.json +4 -4
- package/plugin/inline/adapter.py +389 -8
- package/plugin/inline/plugin.yaml +26 -2
- package/plugin/inline/sidecar/index.mjs +272 -48
- package/plugin/inline/tools.py +92 -3
|
@@ -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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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);
|
|
@@ -24275,6 +24275,21 @@ async function handleRequest(req, res) {
|
|
|
24275
24275
|
case "/history":
|
|
24276
24276
|
await endpointHistory(res, body);
|
|
24277
24277
|
return;
|
|
24278
|
+
case "/search":
|
|
24279
|
+
await endpointSearch(res, body);
|
|
24280
|
+
return;
|
|
24281
|
+
case "/reaction":
|
|
24282
|
+
await endpointReaction(res, body);
|
|
24283
|
+
return;
|
|
24284
|
+
case "/reactions":
|
|
24285
|
+
await endpointReactions(res, body);
|
|
24286
|
+
return;
|
|
24287
|
+
case "/pin":
|
|
24288
|
+
await endpointPin(res, body);
|
|
24289
|
+
return;
|
|
24290
|
+
case "/pins":
|
|
24291
|
+
await endpointPins(res, body);
|
|
24292
|
+
return;
|
|
24278
24293
|
case "/create-subthread":
|
|
24279
24294
|
await endpointCreateSubthread(res, body);
|
|
24280
24295
|
return;
|
|
@@ -24441,19 +24456,27 @@ async function endpointChat(res, body) {
|
|
|
24441
24456
|
});
|
|
24442
24457
|
return;
|
|
24443
24458
|
}
|
|
24444
|
-
const
|
|
24459
|
+
const snapshot = await getRawChatSnapshot(target.chatId);
|
|
24460
|
+
const chat = snapshot.chat;
|
|
24445
24461
|
writeJson(res, 200, {
|
|
24446
24462
|
ok: true,
|
|
24447
24463
|
result: {
|
|
24448
|
-
chatId: chat.chatId.toString(),
|
|
24449
|
-
title: chat.title,
|
|
24450
|
-
...chat.
|
|
24464
|
+
chatId: chat.id?.toString() ?? target.chatId.toString(),
|
|
24465
|
+
title: chat.title ?? "",
|
|
24466
|
+
...chat.peerId != null ? { peer: safeJson(chat.peerId) } : {},
|
|
24451
24467
|
...chat.spaceId != null ? { spaceId: chat.spaceId.toString() } : {},
|
|
24452
24468
|
...chat.parentChatId != null ? { parentChatId: chat.parentChatId.toString() } : {},
|
|
24453
24469
|
...chat.parentMessageId != null ? { parentMessageId: chat.parentMessageId.toString() } : {},
|
|
24470
|
+
...chat.description != null ? { description: chat.description } : {},
|
|
24471
|
+
...chat.emoji != null ? { emoji: chat.emoji } : {},
|
|
24454
24472
|
...chat.isPublic != null ? { isPublic: chat.isPublic } : {},
|
|
24473
|
+
...chat.lastMsgId != null ? { lastMsgId: chat.lastMsgId.toString() } : {},
|
|
24474
|
+
...chat.date != null ? { date: chat.date.toString() } : {},
|
|
24475
|
+
...chat.createdBy != null ? { createdBy: chat.createdBy.toString() } : {},
|
|
24455
24476
|
...chat.untitled != null ? { untitled: chat.untitled } : {},
|
|
24456
24477
|
...chat.number != null ? { number: chat.number } : {},
|
|
24478
|
+
pinnedMessageIds: safeJson(snapshot.pinnedMessageIds),
|
|
24479
|
+
...snapshot.anchorMessage != null ? { anchorMessage: safeJson(snapshot.anchorMessage) } : {},
|
|
24457
24480
|
chat: safeJson(chat)
|
|
24458
24481
|
}
|
|
24459
24482
|
});
|
|
@@ -24482,6 +24505,100 @@ async function endpointHistory(res, body) {
|
|
|
24482
24505
|
const history = result;
|
|
24483
24506
|
writeJson(res, 200, { ok: true, result: { messages: safeJson(history.getChatHistory?.messages ?? []) } });
|
|
24484
24507
|
}
|
|
24508
|
+
async function endpointSearch(res, body) {
|
|
24509
|
+
const record = asRecord(body);
|
|
24510
|
+
const target = parseTarget(record);
|
|
24511
|
+
const query = readRequiredString(record, "query").trim();
|
|
24512
|
+
if (!query)
|
|
24513
|
+
throw new SidecarError("search requires query", "bad_format");
|
|
24514
|
+
const limit = clampResultLimit(readOptionalNumber(record, "limit") ?? 20, 100);
|
|
24515
|
+
const offsetId = readOptionalString(record, "offsetId");
|
|
24516
|
+
const result = await client.invokeUncheckedRaw(Method.SEARCH_MESSAGES, {
|
|
24517
|
+
oneofKind: "searchMessages",
|
|
24518
|
+
searchMessages: {
|
|
24519
|
+
peerId: inputPeerFromTarget(target),
|
|
24520
|
+
queries: [query],
|
|
24521
|
+
limit,
|
|
24522
|
+
...offsetId ? { offsetId: BigInt(offsetId) } : {}
|
|
24523
|
+
}
|
|
24524
|
+
});
|
|
24525
|
+
const typed = result;
|
|
24526
|
+
writeJson(res, 200, { ok: true, result: { messages: safeJson(typed.searchMessages?.messages ?? []) } });
|
|
24527
|
+
}
|
|
24528
|
+
async function endpointReaction(res, body) {
|
|
24529
|
+
const record = asRecord(body);
|
|
24530
|
+
const target = parseTarget(record);
|
|
24531
|
+
const messageId = readRequiredString(record, "messageId");
|
|
24532
|
+
const emoji = readRequiredString(record, "emoji").trim();
|
|
24533
|
+
if (!emoji)
|
|
24534
|
+
throw new SidecarError("reaction requires emoji", "bad_format");
|
|
24535
|
+
const remove = readOptionalBoolean(record, "remove") ?? false;
|
|
24536
|
+
if (remove) {
|
|
24537
|
+
await client.invokeUncheckedRaw(Method.DELETE_REACTION, {
|
|
24538
|
+
oneofKind: "deleteReaction",
|
|
24539
|
+
deleteReaction: {
|
|
24540
|
+
emoji,
|
|
24541
|
+
peerId: inputPeerFromTarget(target),
|
|
24542
|
+
messageId: BigInt(messageId)
|
|
24543
|
+
}
|
|
24544
|
+
});
|
|
24545
|
+
} else {
|
|
24546
|
+
await client.invokeUncheckedRaw(Method.ADD_REACTION, {
|
|
24547
|
+
oneofKind: "addReaction",
|
|
24548
|
+
addReaction: {
|
|
24549
|
+
emoji,
|
|
24550
|
+
messageId: BigInt(messageId),
|
|
24551
|
+
peerId: inputPeerFromTarget(target)
|
|
24552
|
+
}
|
|
24553
|
+
});
|
|
24554
|
+
}
|
|
24555
|
+
writeJson(res, 200, { ok: true, result: { messageId, emoji, removed: remove } });
|
|
24556
|
+
}
|
|
24557
|
+
async function endpointReactions(res, body) {
|
|
24558
|
+
const record = asRecord(body);
|
|
24559
|
+
const target = parseTarget(record);
|
|
24560
|
+
const messageId = readRequiredString(record, "messageId");
|
|
24561
|
+
const result = "chatId" in target ? await client.getMessages({ chatId: target.chatId, messageIds: [BigInt(messageId)] }) : await client.getMessages({ userId: target.userId, messageIds: [BigInt(messageId)] });
|
|
24562
|
+
const message = result.messages[0] ?? null;
|
|
24563
|
+
writeJson(res, 200, {
|
|
24564
|
+
ok: true,
|
|
24565
|
+
result: {
|
|
24566
|
+
message: safeJson(message),
|
|
24567
|
+
reactions: safeJson(reactionsFromMessage(message))
|
|
24568
|
+
}
|
|
24569
|
+
});
|
|
24570
|
+
}
|
|
24571
|
+
async function endpointPin(res, body) {
|
|
24572
|
+
const record = asRecord(body);
|
|
24573
|
+
const target = parseTarget(record);
|
|
24574
|
+
const messageId = readRequiredString(record, "messageId");
|
|
24575
|
+
const unpin = readOptionalBoolean(record, "unpin") ?? false;
|
|
24576
|
+
await client.invokeUncheckedRaw(Method.PIN_MESSAGE, {
|
|
24577
|
+
oneofKind: "pinMessage",
|
|
24578
|
+
pinMessage: {
|
|
24579
|
+
peerId: inputPeerFromTarget(target),
|
|
24580
|
+
messageId: BigInt(messageId),
|
|
24581
|
+
unpin
|
|
24582
|
+
}
|
|
24583
|
+
});
|
|
24584
|
+
writeJson(res, 200, { ok: true, result: { messageId, unpinned: unpin } });
|
|
24585
|
+
}
|
|
24586
|
+
async function endpointPins(res, body) {
|
|
24587
|
+
const record = asRecord(body);
|
|
24588
|
+
const target = parseTarget(record);
|
|
24589
|
+
if ("userId" in target) {
|
|
24590
|
+
throw new SidecarError("pins requires a chat target", "bad_format");
|
|
24591
|
+
}
|
|
24592
|
+
const snapshot = await getRawChatSnapshot(target.chatId);
|
|
24593
|
+
writeJson(res, 200, {
|
|
24594
|
+
ok: true,
|
|
24595
|
+
result: {
|
|
24596
|
+
chatId: target.chatId.toString(),
|
|
24597
|
+
pinnedMessageIds: safeJson(snapshot.pinnedMessageIds),
|
|
24598
|
+
...snapshot.anchorMessage != null ? { anchorMessage: safeJson(snapshot.anchorMessage) } : {}
|
|
24599
|
+
}
|
|
24600
|
+
});
|
|
24601
|
+
}
|
|
24485
24602
|
async function endpointCreateSubthread(res, body) {
|
|
24486
24603
|
const record = asRecord(body);
|
|
24487
24604
|
const parentChatId = readRequiredString(record, "parentChatId");
|
|
@@ -24510,6 +24627,32 @@ async function endpointCreateSubthread(res, body) {
|
|
|
24510
24627
|
}
|
|
24511
24628
|
});
|
|
24512
24629
|
}
|
|
24630
|
+
async function getRawChatSnapshot(chatId) {
|
|
24631
|
+
const result = await client.invoke(Method.GET_CHAT, {
|
|
24632
|
+
oneofKind: "getChat",
|
|
24633
|
+
getChat: GetChatInput.create({ peerId: inputPeerFromTarget({ chatId }) })
|
|
24634
|
+
});
|
|
24635
|
+
const typed = result;
|
|
24636
|
+
const chat = typed.getChat?.chat;
|
|
24637
|
+
if (!chat)
|
|
24638
|
+
throw new SidecarError("chat not found", "not_found");
|
|
24639
|
+
return {
|
|
24640
|
+
chat,
|
|
24641
|
+
pinnedMessageIds: typed.getChat?.pinnedMessageIds ?? [],
|
|
24642
|
+
...typed.getChat?.anchorMessage != null ? { anchorMessage: typed.getChat.anchorMessage } : {}
|
|
24643
|
+
};
|
|
24644
|
+
}
|
|
24645
|
+
function reactionsFromMessage(message) {
|
|
24646
|
+
if (!message || typeof message !== "object" || !("reactions" in message))
|
|
24647
|
+
return null;
|
|
24648
|
+
return message.reactions ?? null;
|
|
24649
|
+
}
|
|
24650
|
+
function clampResultLimit(value, max) {
|
|
24651
|
+
if (!Number.isInteger(value) || value < 1) {
|
|
24652
|
+
throw new SidecarError("limit must be a positive integer", "bad_format");
|
|
24653
|
+
}
|
|
24654
|
+
return Math.min(value, max);
|
|
24655
|
+
}
|
|
24513
24656
|
async function endpointAnswerAction(res, body) {
|
|
24514
24657
|
const record = asRecord(body);
|
|
24515
24658
|
const interactionId = readRequiredString(record, "interactionId");
|
|
@@ -24638,7 +24781,16 @@ class MockInlineClient {
|
|
|
24638
24781
|
chatId: "chatId" in params ? BigInt(params.chatId) : undefined,
|
|
24639
24782
|
peerId: "chatId" in params ? { type: { oneofKind: "chat", chat: { chatId: BigInt(params.chatId) } } } : { type: { oneofKind: "user", user: { userId: BigInt(params.userId) } } },
|
|
24640
24783
|
message: `mock message ${id.toString()}`,
|
|
24641
|
-
date: 123n
|
|
24784
|
+
date: 123n,
|
|
24785
|
+
reactions: {
|
|
24786
|
+
reactions: [{
|
|
24787
|
+
emoji: "ok",
|
|
24788
|
+
userId: 222n,
|
|
24789
|
+
messageId: BigInt(id),
|
|
24790
|
+
chatId: "chatId" in params ? BigInt(params.chatId) : 0n,
|
|
24791
|
+
date: 125n
|
|
24792
|
+
}]
|
|
24793
|
+
}
|
|
24642
24794
|
}))
|
|
24643
24795
|
};
|
|
24644
24796
|
}
|
|
@@ -24673,6 +24825,34 @@ class MockInlineClient {
|
|
|
24673
24825
|
}
|
|
24674
24826
|
async invoke(method, input) {
|
|
24675
24827
|
this.record(`invoke:${methodName(method)}`, input);
|
|
24828
|
+
if (method === Method.GET_CHAT) {
|
|
24829
|
+
const inputRecord = asOptionalRecord(input);
|
|
24830
|
+
const getChat = asOptionalRecord(inputRecord?.getChat);
|
|
24831
|
+
const chatId = chatIdFromInputPeer(getChat?.peerId) ?? 123n;
|
|
24832
|
+
const chat = chatId === 456n ? {
|
|
24833
|
+
id: chatId,
|
|
24834
|
+
title: "Mock reply thread 456",
|
|
24835
|
+
parentChatId: 123n,
|
|
24836
|
+
parentMessageId: 9001n,
|
|
24837
|
+
untitled: true
|
|
24838
|
+
} : {
|
|
24839
|
+
id: chatId,
|
|
24840
|
+
title: `Mock chat ${chatId.toString()}`
|
|
24841
|
+
};
|
|
24842
|
+
return {
|
|
24843
|
+
getChat: {
|
|
24844
|
+
chat,
|
|
24845
|
+
pinnedMessageIds: [8801n],
|
|
24846
|
+
anchorMessage: {
|
|
24847
|
+
id: 8801n,
|
|
24848
|
+
fromId: 111n,
|
|
24849
|
+
chatId,
|
|
24850
|
+
message: "mock pinned message",
|
|
24851
|
+
date: 126n
|
|
24852
|
+
}
|
|
24853
|
+
}
|
|
24854
|
+
};
|
|
24855
|
+
}
|
|
24676
24856
|
if (method === Method.GET_CHAT_HISTORY) {
|
|
24677
24857
|
return {
|
|
24678
24858
|
getChatHistory: {
|
|
@@ -24702,6 +24882,35 @@ class MockInlineClient {
|
|
|
24702
24882
|
}
|
|
24703
24883
|
};
|
|
24704
24884
|
}
|
|
24885
|
+
if (method === Method.SEARCH_MESSAGES) {
|
|
24886
|
+
const inputRecord = asOptionalRecord(input);
|
|
24887
|
+
const searchMessages = asOptionalRecord(inputRecord?.searchMessages);
|
|
24888
|
+
const peerId = searchMessages?.peerId;
|
|
24889
|
+
const chatId = chatIdFromInputPeer(peerId) ?? 123n;
|
|
24890
|
+
const queries = Array.isArray(searchMessages?.queries) ? searchMessages.queries : [];
|
|
24891
|
+
return {
|
|
24892
|
+
oneofKind: "searchMessages",
|
|
24893
|
+
searchMessages: {
|
|
24894
|
+
messages: [{
|
|
24895
|
+
id: 8802n,
|
|
24896
|
+
fromId: 111n,
|
|
24897
|
+
chatId,
|
|
24898
|
+
peerId,
|
|
24899
|
+
message: `mock search ${String(queries[0] ?? "")}`.trim(),
|
|
24900
|
+
date: 127n
|
|
24901
|
+
}]
|
|
24902
|
+
}
|
|
24903
|
+
};
|
|
24904
|
+
}
|
|
24905
|
+
if (method === Method.ADD_REACTION) {
|
|
24906
|
+
return { oneofKind: "addReaction", addReaction: { updates: [] } };
|
|
24907
|
+
}
|
|
24908
|
+
if (method === Method.DELETE_REACTION) {
|
|
24909
|
+
return { oneofKind: "deleteReaction", deleteReaction: { updates: [] } };
|
|
24910
|
+
}
|
|
24911
|
+
if (method === Method.PIN_MESSAGE) {
|
|
24912
|
+
return { oneofKind: "pinMessage", pinMessage: { updates: [] } };
|
|
24913
|
+
}
|
|
24705
24914
|
return { oneofKind: undefined };
|
|
24706
24915
|
}
|
|
24707
24916
|
record(method, params) {
|
|
@@ -24717,6 +24926,21 @@ function binarySize(value) {
|
|
|
24717
24926
|
return value.size;
|
|
24718
24927
|
return null;
|
|
24719
24928
|
}
|
|
24929
|
+
function chatIdFromInputPeer(peer) {
|
|
24930
|
+
const inputPeer = asOptionalRecord(peer);
|
|
24931
|
+
const type = asOptionalRecord(inputPeer?.type);
|
|
24932
|
+
if (type?.oneofKind !== "chat")
|
|
24933
|
+
return null;
|
|
24934
|
+
const chat = asOptionalRecord(type.chat);
|
|
24935
|
+
const chatId = chat?.chatId;
|
|
24936
|
+
if (chatId == null)
|
|
24937
|
+
return null;
|
|
24938
|
+
try {
|
|
24939
|
+
return BigInt(String(chatId));
|
|
24940
|
+
} catch {
|
|
24941
|
+
return null;
|
|
24942
|
+
}
|
|
24943
|
+
}
|
|
24720
24944
|
function methodName(method) {
|
|
24721
24945
|
return Method[method] ?? String(method);
|
|
24722
24946
|
}
|