@inline-chat/hermes-agent-adapter 1.0.0-alpha.3 → 1.0.0
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/dist/install.js +95 -95
- package/package.json +10 -4
- package/plugin/inline/adapter.py +95 -67
- package/plugin/inline/cli.py +9 -2
- package/plugin/inline/plugin.yaml +1 -1
- package/plugin/inline/sidecar/index.mjs +846 -801
- package/plugin/inline/tools.py +12 -2
|
@@ -18,7 +18,7 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
18
18
|
return cached;
|
|
19
19
|
}
|
|
20
20
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
21
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
21
|
+
const to = isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
22
22
|
if (mod && typeof mod === "object" || typeof mod === "function") {
|
|
23
23
|
for (let key of __getOwnPropNames(mod))
|
|
24
24
|
if (!__hasOwnProp.call(to, key))
|
|
@@ -189,38 +189,38 @@ var require_binary_format_contract = __commonJS(function(exports) {
|
|
|
189
189
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
190
190
|
exports.WireType = exports.mergeBinaryOptions = exports.UnknownFieldHandler = undefined;
|
|
191
191
|
var UnknownFieldHandler;
|
|
192
|
-
(function(
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
let container = is(message) ? message[
|
|
192
|
+
(function(UnknownFieldHandler) {
|
|
193
|
+
UnknownFieldHandler.symbol = Symbol.for("protobuf-ts/unknown");
|
|
194
|
+
UnknownFieldHandler.onRead = (typeName, message, fieldNo, wireType, data) => {
|
|
195
|
+
let container = is(message) ? message[UnknownFieldHandler.symbol] : message[UnknownFieldHandler.symbol] = [];
|
|
196
196
|
container.push({ no: fieldNo, wireType, data });
|
|
197
197
|
};
|
|
198
|
-
|
|
199
|
-
for (let { no, wireType, data } of
|
|
198
|
+
UnknownFieldHandler.onWrite = (typeName, message, writer) => {
|
|
199
|
+
for (let { no, wireType, data } of UnknownFieldHandler.list(message))
|
|
200
200
|
writer.tag(no, wireType).raw(data);
|
|
201
201
|
};
|
|
202
|
-
|
|
202
|
+
UnknownFieldHandler.list = (message, fieldNo) => {
|
|
203
203
|
if (is(message)) {
|
|
204
|
-
let all = message[
|
|
204
|
+
let all = message[UnknownFieldHandler.symbol];
|
|
205
205
|
return fieldNo ? all.filter((uf) => uf.no == fieldNo) : all;
|
|
206
206
|
}
|
|
207
207
|
return [];
|
|
208
208
|
};
|
|
209
|
-
|
|
210
|
-
const is = (message) => message && Array.isArray(message[
|
|
209
|
+
UnknownFieldHandler.last = (message, fieldNo) => UnknownFieldHandler.list(message, fieldNo).slice(-1)[0];
|
|
210
|
+
const is = (message) => message && Array.isArray(message[UnknownFieldHandler.symbol]);
|
|
211
211
|
})(UnknownFieldHandler = exports.UnknownFieldHandler || (exports.UnknownFieldHandler = {}));
|
|
212
212
|
function mergeBinaryOptions(a, b) {
|
|
213
213
|
return Object.assign(Object.assign({}, a), b);
|
|
214
214
|
}
|
|
215
215
|
exports.mergeBinaryOptions = mergeBinaryOptions;
|
|
216
216
|
var WireType;
|
|
217
|
-
(function(
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
217
|
+
(function(WireType) {
|
|
218
|
+
WireType[WireType["Varint"] = 0] = "Varint";
|
|
219
|
+
WireType[WireType["Bit64"] = 1] = "Bit64";
|
|
220
|
+
WireType[WireType["LengthDelimited"] = 2] = "LengthDelimited";
|
|
221
|
+
WireType[WireType["StartGroup"] = 3] = "StartGroup";
|
|
222
|
+
WireType[WireType["EndGroup"] = 4] = "EndGroup";
|
|
223
|
+
WireType[WireType["Bit32"] = 5] = "Bit32";
|
|
224
224
|
})(WireType = exports.WireType || (exports.WireType = {}));
|
|
225
225
|
});
|
|
226
226
|
|
|
@@ -967,34 +967,34 @@ var require_reflection_info = __commonJS(function(exports) {
|
|
|
967
967
|
exports.readMessageOption = exports.readFieldOption = exports.readFieldOptions = exports.normalizeFieldInfo = exports.RepeatType = exports.LongType = exports.ScalarType = undefined;
|
|
968
968
|
var lower_camel_case_1 = require_lower_camel_case();
|
|
969
969
|
var ScalarType;
|
|
970
|
-
(function(
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
970
|
+
(function(ScalarType) {
|
|
971
|
+
ScalarType[ScalarType["DOUBLE"] = 1] = "DOUBLE";
|
|
972
|
+
ScalarType[ScalarType["FLOAT"] = 2] = "FLOAT";
|
|
973
|
+
ScalarType[ScalarType["INT64"] = 3] = "INT64";
|
|
974
|
+
ScalarType[ScalarType["UINT64"] = 4] = "UINT64";
|
|
975
|
+
ScalarType[ScalarType["INT32"] = 5] = "INT32";
|
|
976
|
+
ScalarType[ScalarType["FIXED64"] = 6] = "FIXED64";
|
|
977
|
+
ScalarType[ScalarType["FIXED32"] = 7] = "FIXED32";
|
|
978
|
+
ScalarType[ScalarType["BOOL"] = 8] = "BOOL";
|
|
979
|
+
ScalarType[ScalarType["STRING"] = 9] = "STRING";
|
|
980
|
+
ScalarType[ScalarType["BYTES"] = 12] = "BYTES";
|
|
981
|
+
ScalarType[ScalarType["UINT32"] = 13] = "UINT32";
|
|
982
|
+
ScalarType[ScalarType["SFIXED32"] = 15] = "SFIXED32";
|
|
983
|
+
ScalarType[ScalarType["SFIXED64"] = 16] = "SFIXED64";
|
|
984
|
+
ScalarType[ScalarType["SINT32"] = 17] = "SINT32";
|
|
985
|
+
ScalarType[ScalarType["SINT64"] = 18] = "SINT64";
|
|
986
986
|
})(ScalarType = exports.ScalarType || (exports.ScalarType = {}));
|
|
987
987
|
var LongType;
|
|
988
|
-
(function(
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
988
|
+
(function(LongType) {
|
|
989
|
+
LongType[LongType["BIGINT"] = 0] = "BIGINT";
|
|
990
|
+
LongType[LongType["STRING"] = 1] = "STRING";
|
|
991
|
+
LongType[LongType["NUMBER"] = 2] = "NUMBER";
|
|
992
992
|
})(LongType = exports.LongType || (exports.LongType = {}));
|
|
993
993
|
var RepeatType;
|
|
994
|
-
(function(
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
994
|
+
(function(RepeatType) {
|
|
995
|
+
RepeatType[RepeatType["NO"] = 0] = "NO";
|
|
996
|
+
RepeatType[RepeatType["PACKED"] = 1] = "PACKED";
|
|
997
|
+
RepeatType[RepeatType["UNPACKED"] = 2] = "UNPACKED";
|
|
998
998
|
})(RepeatType = exports.RepeatType || (exports.RepeatType = {}));
|
|
999
999
|
function normalizeFieldInfo(field) {
|
|
1000
1000
|
var _a, _b, _c, _d;
|
|
@@ -1567,8 +1567,8 @@ var require_reflection_json_reader = __commonJS(function(exports) {
|
|
|
1567
1567
|
}
|
|
1568
1568
|
try {
|
|
1569
1569
|
encodeURIComponent(json);
|
|
1570
|
-
} catch (
|
|
1571
|
-
|
|
1570
|
+
} catch (e) {
|
|
1571
|
+
e = "invalid UTF8";
|
|
1572
1572
|
break;
|
|
1573
1573
|
}
|
|
1574
1574
|
return json;
|
|
@@ -1606,9 +1606,9 @@ var require_reflection_json_writer = __commonJS(function(exports) {
|
|
|
1606
1606
|
const json = {}, source = message;
|
|
1607
1607
|
for (const field of this.fields) {
|
|
1608
1608
|
if (!field.oneof) {
|
|
1609
|
-
let
|
|
1610
|
-
if (
|
|
1611
|
-
json[options.useProtoFieldName ? field.name : field.jsonName] =
|
|
1609
|
+
let jsonValue = this.field(field, source[field.localName], options);
|
|
1610
|
+
if (jsonValue !== undefined)
|
|
1611
|
+
json[options.useProtoFieldName ? field.name : field.jsonName] = jsonValue;
|
|
1612
1612
|
continue;
|
|
1613
1613
|
}
|
|
1614
1614
|
const group = source[field.oneof];
|
|
@@ -1857,7 +1857,7 @@ var require_reflection_binary_reader = __commonJS(function(exports) {
|
|
|
1857
1857
|
(u === true ? binary_format_contract_1.UnknownFieldHandler.onRead : u)(this.info.typeName, message, fieldNo, wireType, d);
|
|
1858
1858
|
continue;
|
|
1859
1859
|
}
|
|
1860
|
-
let target = message,
|
|
1860
|
+
let target = message, { repeat: repeated, localName } = field;
|
|
1861
1861
|
if (field.oneof) {
|
|
1862
1862
|
target = target[field.oneof];
|
|
1863
1863
|
if (target.oneofKind !== localName)
|
|
@@ -2005,7 +2005,7 @@ var require_reflection_binary_writer = __commonJS(function(exports) {
|
|
|
2005
2005
|
write(message, writer, options) {
|
|
2006
2006
|
this.prepare();
|
|
2007
2007
|
for (const field of this.fields) {
|
|
2008
|
-
let value, emitDefault,
|
|
2008
|
+
let value, emitDefault, { repeat: repeated, localName } = field;
|
|
2009
2009
|
if (field.oneof) {
|
|
2010
2010
|
const group = message[field.oneof];
|
|
2011
2011
|
if (group.oneofKind !== localName)
|
|
@@ -2270,9 +2270,9 @@ var require_reflection_merge_partial = __commonJS(function(exports) {
|
|
|
2270
2270
|
Object.assign(output[name], fieldValue);
|
|
2271
2271
|
break;
|
|
2272
2272
|
case "message":
|
|
2273
|
-
let
|
|
2273
|
+
let T = field.V.T();
|
|
2274
2274
|
for (let k of Object.keys(fieldValue))
|
|
2275
|
-
output[name][k] =
|
|
2275
|
+
output[name][k] = T.create(fieldValue[k]);
|
|
2276
2276
|
break;
|
|
2277
2277
|
}
|
|
2278
2278
|
break;
|
|
@@ -2487,12 +2487,12 @@ var require_enum_object = __commonJS(function(exports) {
|
|
|
2487
2487
|
if (arg[nam] !== num)
|
|
2488
2488
|
return false;
|
|
2489
2489
|
} else {
|
|
2490
|
-
let
|
|
2491
|
-
if (
|
|
2490
|
+
let num = arg[k];
|
|
2491
|
+
if (num === undefined)
|
|
2492
2492
|
return false;
|
|
2493
|
-
if (typeof
|
|
2493
|
+
if (typeof num !== "number")
|
|
2494
2494
|
return false;
|
|
2495
|
-
if (arg[
|
|
2495
|
+
if (arg[num] === undefined)
|
|
2496
2496
|
return false;
|
|
2497
2497
|
}
|
|
2498
2498
|
}
|
|
@@ -2724,6 +2724,7 @@ var require_constants = __commonJS(function(exports, module) {
|
|
|
2724
2724
|
|
|
2725
2725
|
// node_modules/ws/lib/buffer-util.js
|
|
2726
2726
|
var require_buffer_util = __commonJS(function(exports, module) {
|
|
2727
|
+
var { websocketMask, websocketUnmask } = __require("http");
|
|
2727
2728
|
var { EMPTY_BUFFER } = require_constants();
|
|
2728
2729
|
var FastBuffer = Buffer[Symbol.species];
|
|
2729
2730
|
function concat(list, totalLength) {
|
|
@@ -2781,14 +2782,27 @@ var require_buffer_util = __commonJS(function(exports, module) {
|
|
|
2781
2782
|
toBuffer,
|
|
2782
2783
|
unmask: _unmask
|
|
2783
2784
|
};
|
|
2784
|
-
if (
|
|
2785
|
+
if (websocketMask) {
|
|
2786
|
+
module.exports.mask = function(source, mask, output, offset, length) {
|
|
2787
|
+
if (length < 24)
|
|
2788
|
+
_mask(source, mask, output, offset, length);
|
|
2789
|
+
else
|
|
2790
|
+
websocketMask(source, mask, output, offset, length);
|
|
2791
|
+
};
|
|
2792
|
+
module.exports.unmask = function(buffer, mask) {
|
|
2793
|
+
if (buffer.length < 24)
|
|
2794
|
+
_unmask(buffer, mask);
|
|
2795
|
+
else
|
|
2796
|
+
websocketUnmask(buffer, mask);
|
|
2797
|
+
};
|
|
2798
|
+
} else if (!process.env.WS_NO_BUFFER_UTIL) {
|
|
2785
2799
|
try {
|
|
2786
2800
|
const bufferUtil = (()=>{throw new Error("Cannot require module "+"bufferutil");})();
|
|
2787
|
-
module.exports.mask = function(source,
|
|
2801
|
+
module.exports.mask = function(source, mask2, output, offset, length) {
|
|
2788
2802
|
if (length < 48)
|
|
2789
|
-
_mask(source,
|
|
2803
|
+
_mask(source, mask2, output, offset, length);
|
|
2790
2804
|
else
|
|
2791
|
-
bufferUtil.mask(source,
|
|
2805
|
+
bufferUtil.mask(source, mask2, output, offset, length);
|
|
2792
2806
|
};
|
|
2793
2807
|
module.exports.unmask = function(buffer, mask) {
|
|
2794
2808
|
if (buffer.length < 32)
|
|
@@ -3021,7 +3035,7 @@ var require_permessage_deflate = __commonJS(function(exports, module) {
|
|
|
3021
3035
|
callback(err);
|
|
3022
3036
|
return;
|
|
3023
3037
|
}
|
|
3024
|
-
const
|
|
3038
|
+
const data = bufferUtil.concat(this._inflate[kBuffers], this._inflate[kTotalLength]);
|
|
3025
3039
|
if (this._inflate._readableState.endEmitted) {
|
|
3026
3040
|
this._inflate.close();
|
|
3027
3041
|
this._inflate = null;
|
|
@@ -3032,7 +3046,7 @@ var require_permessage_deflate = __commonJS(function(exports, module) {
|
|
|
3032
3046
|
this._inflate.reset();
|
|
3033
3047
|
}
|
|
3034
3048
|
}
|
|
3035
|
-
callback(null,
|
|
3049
|
+
callback(null, data);
|
|
3036
3050
|
});
|
|
3037
3051
|
}
|
|
3038
3052
|
_compress(data, fin, callback) {
|
|
@@ -3054,9 +3068,9 @@ var require_permessage_deflate = __commonJS(function(exports, module) {
|
|
|
3054
3068
|
if (!this._deflate) {
|
|
3055
3069
|
return;
|
|
3056
3070
|
}
|
|
3057
|
-
let
|
|
3071
|
+
let data = bufferUtil.concat(this._deflate[kBuffers], this._deflate[kTotalLength]);
|
|
3058
3072
|
if (fin) {
|
|
3059
|
-
|
|
3073
|
+
data = new FastBuffer(data.buffer, data.byteOffset, data.length - 4);
|
|
3060
3074
|
}
|
|
3061
3075
|
this._deflate[kCallback] = null;
|
|
3062
3076
|
this._deflate[kTotalLength] = 0;
|
|
@@ -3064,7 +3078,7 @@ var require_permessage_deflate = __commonJS(function(exports, module) {
|
|
|
3064
3078
|
if (fin && this.params[`${endpoint}_no_context_takeover`]) {
|
|
3065
3079
|
this._deflate.reset();
|
|
3066
3080
|
}
|
|
3067
|
-
callback(null,
|
|
3081
|
+
callback(null, data);
|
|
3068
3082
|
});
|
|
3069
3083
|
}
|
|
3070
3084
|
}
|
|
@@ -3769,13 +3783,16 @@ var require_sender = __commonJS(function(exports, module) {
|
|
|
3769
3783
|
target[2] = target[3] = 0;
|
|
3770
3784
|
target.writeUIntBE(dataLength, 4, 6);
|
|
3771
3785
|
}
|
|
3772
|
-
if (!options.mask)
|
|
3773
|
-
return [target, data];
|
|
3786
|
+
if (!options.mask) {
|
|
3787
|
+
return dataLength ? [target, data] : [target];
|
|
3788
|
+
}
|
|
3774
3789
|
target[1] |= 128;
|
|
3775
3790
|
target[offset - 4] = mask[0];
|
|
3776
3791
|
target[offset - 3] = mask[1];
|
|
3777
3792
|
target[offset - 2] = mask[2];
|
|
3778
3793
|
target[offset - 1] = mask[3];
|
|
3794
|
+
if (!dataLength)
|
|
3795
|
+
return [target];
|
|
3779
3796
|
if (skipMasking)
|
|
3780
3797
|
return [target, data];
|
|
3781
3798
|
if (merge) {
|
|
@@ -4789,7 +4806,7 @@ var require_websocket = __commonJS(function(exports, module) {
|
|
|
4789
4806
|
}
|
|
4790
4807
|
const defaultPort = isSecure ? 443 : 80;
|
|
4791
4808
|
const key = randomBytes(16).toString("base64");
|
|
4792
|
-
const
|
|
4809
|
+
const request3 = isSecure ? https.request : http.request;
|
|
4793
4810
|
const protocolSet = new Set;
|
|
4794
4811
|
let perMessageDeflate;
|
|
4795
4812
|
opts.createConnection = opts.createConnection || (isSecure ? tlsConnect : netConnect);
|
|
@@ -4835,9 +4852,14 @@ var require_websocket = __commonJS(function(exports, module) {
|
|
|
4835
4852
|
opts.auth = `${parsedUrl.username}:${parsedUrl.password}`;
|
|
4836
4853
|
}
|
|
4837
4854
|
if (isIpcUrl) {
|
|
4838
|
-
const
|
|
4839
|
-
|
|
4840
|
-
|
|
4855
|
+
const i = opts.path.indexOf(":");
|
|
4856
|
+
if (i === -1) {
|
|
4857
|
+
opts.socketPath = opts.path;
|
|
4858
|
+
opts.path = "";
|
|
4859
|
+
} else {
|
|
4860
|
+
opts.socketPath = opts.path.slice(0, i);
|
|
4861
|
+
opts.path = opts.path.slice(i + 1);
|
|
4862
|
+
}
|
|
4841
4863
|
}
|
|
4842
4864
|
let req;
|
|
4843
4865
|
if (opts.followRedirects) {
|
|
@@ -4848,8 +4870,8 @@ var require_websocket = __commonJS(function(exports, module) {
|
|
|
4848
4870
|
const headers = options && options.headers;
|
|
4849
4871
|
options = { ...options, headers: {} };
|
|
4850
4872
|
if (headers) {
|
|
4851
|
-
for (const [
|
|
4852
|
-
options.headers[
|
|
4873
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
4874
|
+
options.headers[key.toLowerCase()] = value;
|
|
4853
4875
|
}
|
|
4854
4876
|
}
|
|
4855
4877
|
} else if (websocket.listenerCount("redirect") === 0) {
|
|
@@ -4865,12 +4887,12 @@ var require_websocket = __commonJS(function(exports, module) {
|
|
|
4865
4887
|
if (opts.auth && !options.headers.authorization) {
|
|
4866
4888
|
options.headers.authorization = "Basic " + Buffer.from(opts.auth).toString("base64");
|
|
4867
4889
|
}
|
|
4868
|
-
req = websocket._req =
|
|
4890
|
+
req = websocket._req = request3(opts);
|
|
4869
4891
|
if (websocket._redirects) {
|
|
4870
4892
|
websocket.emit("redirect", websocket.url, req);
|
|
4871
4893
|
}
|
|
4872
4894
|
} else {
|
|
4873
|
-
req = websocket._req =
|
|
4895
|
+
req = websocket._req = request3(opts);
|
|
4874
4896
|
}
|
|
4875
4897
|
if (opts.timeout) {
|
|
4876
4898
|
req.on("timeout", () => {
|
|
@@ -5188,9 +5210,9 @@ var require_stream = __commonJS(function(exports, module) {
|
|
|
5188
5210
|
return;
|
|
5189
5211
|
}
|
|
5190
5212
|
let called = false;
|
|
5191
|
-
ws.once("error", function error(
|
|
5213
|
+
ws.once("error", function error(err) {
|
|
5192
5214
|
called = true;
|
|
5193
|
-
callback(
|
|
5215
|
+
callback(err);
|
|
5194
5216
|
});
|
|
5195
5217
|
ws.once("close", function close() {
|
|
5196
5218
|
if (!called)
|
|
@@ -5262,11 +5284,11 @@ var require_subprotocol = __commonJS(function(exports, module) {
|
|
|
5262
5284
|
}
|
|
5263
5285
|
if (end === -1)
|
|
5264
5286
|
end = i;
|
|
5265
|
-
const
|
|
5266
|
-
if (protocols.has(
|
|
5267
|
-
throw new SyntaxError(`The "${
|
|
5287
|
+
const protocol = header.slice(start, end);
|
|
5288
|
+
if (protocols.has(protocol)) {
|
|
5289
|
+
throw new SyntaxError(`The "${protocol}" subprotocol is duplicated`);
|
|
5268
5290
|
}
|
|
5269
|
-
protocols.add(
|
|
5291
|
+
protocols.add(protocol);
|
|
5270
5292
|
start = end = -1;
|
|
5271
5293
|
} else {
|
|
5272
5294
|
throw new SyntaxError(`Unexpected character at index ${i}`);
|
|
@@ -5754,9 +5776,13 @@ function normalizeError(error, redact = defaultErrorText) {
|
|
|
5754
5776
|
};
|
|
5755
5777
|
}
|
|
5756
5778
|
const message = redact(error);
|
|
5779
|
+
if (errorCode(error) === "commit-outcome-unknown") {
|
|
5780
|
+
return { status: 504, errorKind: "unknown", message, outcomeUnknown: true };
|
|
5781
|
+
}
|
|
5757
5782
|
const lower = message.toLowerCase();
|
|
5758
|
-
if (lower.includes("rate") && lower.includes("limit")) {
|
|
5759
|
-
|
|
5783
|
+
if (isRateLimitCode(error) || lower.includes("rate") && lower.includes("limit")) {
|
|
5784
|
+
const retryAfterSeconds = error?.retryAfterSeconds;
|
|
5785
|
+
return typeof retryAfterSeconds === "number" && retryAfterSeconds > 0 ? { status: 429, errorKind: "rate_limited", message, retryAfterSeconds } : { status: 429, errorKind: "rate_limited", message };
|
|
5760
5786
|
}
|
|
5761
5787
|
if (lower.includes("forbidden") || lower.includes("unauthorized")) {
|
|
5762
5788
|
return { status: 403, errorKind: "forbidden", message };
|
|
@@ -5769,6 +5795,15 @@ function normalizeError(error, redact = defaultErrorText) {
|
|
|
5769
5795
|
}
|
|
5770
5796
|
return { status: 500, errorKind: "unknown", message };
|
|
5771
5797
|
}
|
|
5798
|
+
function errorCode(error) {
|
|
5799
|
+
return typeof error === "object" && error !== null ? error.code : undefined;
|
|
5800
|
+
}
|
|
5801
|
+
function isRateLimitCode(error) {
|
|
5802
|
+
if (errorCode(error) !== "rpc-error")
|
|
5803
|
+
return false;
|
|
5804
|
+
const rpcCode = error.rpcCode;
|
|
5805
|
+
return rpcCode === 3 || rpcCode === 429;
|
|
5806
|
+
}
|
|
5772
5807
|
function statusForErrorKind(errorKind) {
|
|
5773
5808
|
switch (errorKind) {
|
|
5774
5809
|
case "bad_format":
|
|
@@ -6022,18 +6057,26 @@ function defaultErrorText(error) {
|
|
|
6022
6057
|
}
|
|
6023
6058
|
|
|
6024
6059
|
// src/sidecar/inbound-delivery.ts
|
|
6060
|
+
var MENTION_SENDER_LOOKUP_MS = 2000;
|
|
6025
6061
|
function explicitlyMentionsSelf(event, meId) {
|
|
6026
6062
|
if (!meId || event.kind !== "message.new" && event.kind !== "message.edit")
|
|
6027
6063
|
return false;
|
|
6028
6064
|
const message = event.message;
|
|
6029
6065
|
return message?.entities?.entities?.some((e) => e.entity?.oneofKind === "mention" && e.entity.mention?.userId?.toString() === meId) ?? false;
|
|
6030
6066
|
}
|
|
6067
|
+
function resolveMentionSender(event, owner) {
|
|
6068
|
+
const unverified = { provenanceVerified: false };
|
|
6069
|
+
return Promise.race([
|
|
6070
|
+
owner.resolveSender(event).catch(() => unverified),
|
|
6071
|
+
delay(owner.mentionSenderLookupMs ?? MENTION_SENDER_LOOKUP_MS, unverified, { signal: owner.signal, ref: false })
|
|
6072
|
+
]);
|
|
6073
|
+
}
|
|
6031
6074
|
async function deliverInboundEvent(event, owner) {
|
|
6032
6075
|
if (inboundEventIsServiceMessage(event))
|
|
6033
6076
|
return;
|
|
6034
6077
|
const explicitMention = explicitlyMentionsSelf(event, owner.meId);
|
|
6035
6078
|
while (!owner.signal.aborted) {
|
|
6036
|
-
const resolution = explicitMention ?
|
|
6079
|
+
const resolution = explicitMention ? await resolveMentionSender(event, owner) : inboundEventNeedsSenderResolution(event) ? await owner.resolveSender(event) : { provenanceVerified: true };
|
|
6037
6080
|
owner.signal.throwIfAborted();
|
|
6038
6081
|
if (!explicitMention && !resolution.provenanceVerified && (event.kind === "message.new" || event.kind === "message.edit")) {
|
|
6039
6082
|
await delay(1000, undefined, { signal: owner.signal });
|
|
@@ -6057,618 +6100,618 @@ var import_runtime2 = __toESM(require_commonjs(), 1);
|
|
|
6057
6100
|
var import_runtime3 = __toESM(require_commonjs(), 1);
|
|
6058
6101
|
var import_runtime4 = __toESM(require_commonjs(), 1);
|
|
6059
6102
|
var ConnectionError_Reason;
|
|
6060
|
-
(function(
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6103
|
+
(function(ConnectionError_Reason) {
|
|
6104
|
+
ConnectionError_Reason[ConnectionError_Reason["REASON_UNSPECIFIED"] = 0] = "REASON_UNSPECIFIED";
|
|
6105
|
+
ConnectionError_Reason[ConnectionError_Reason["UNAUTHORIZED"] = 1] = "UNAUTHORIZED";
|
|
6106
|
+
ConnectionError_Reason[ConnectionError_Reason["INVALID_AUTH"] = 2] = "INVALID_AUTH";
|
|
6107
|
+
ConnectionError_Reason[ConnectionError_Reason["SESSION_REVOKED"] = 3] = "SESSION_REVOKED";
|
|
6065
6108
|
})(ConnectionError_Reason || (ConnectionError_Reason = {}));
|
|
6066
6109
|
var BotAvatar_Kind;
|
|
6067
|
-
(function(
|
|
6068
|
-
|
|
6069
|
-
|
|
6110
|
+
(function(BotAvatar_Kind) {
|
|
6111
|
+
BotAvatar_Kind[BotAvatar_Kind["KIND_UNSPECIFIED"] = 0] = "KIND_UNSPECIFIED";
|
|
6112
|
+
BotAvatar_Kind[BotAvatar_Kind["CODEX_ATLAS"] = 1] = "CODEX_ATLAS";
|
|
6070
6113
|
})(BotAvatar_Kind || (BotAvatar_Kind = {}));
|
|
6071
6114
|
var BotPresenceState_Kind;
|
|
6072
|
-
(function(
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
|
|
6115
|
+
(function(BotPresenceState_Kind) {
|
|
6116
|
+
BotPresenceState_Kind[BotPresenceState_Kind["KIND_UNSPECIFIED"] = 0] = "KIND_UNSPECIFIED";
|
|
6117
|
+
BotPresenceState_Kind[BotPresenceState_Kind["HIDDEN"] = 1] = "HIDDEN";
|
|
6118
|
+
BotPresenceState_Kind[BotPresenceState_Kind["IDLE"] = 2] = "IDLE";
|
|
6119
|
+
BotPresenceState_Kind[BotPresenceState_Kind["HAPPY"] = 3] = "HAPPY";
|
|
6120
|
+
BotPresenceState_Kind[BotPresenceState_Kind["WAVING"] = 4] = "WAVING";
|
|
6121
|
+
BotPresenceState_Kind[BotPresenceState_Kind["JUMPING"] = 5] = "JUMPING";
|
|
6122
|
+
BotPresenceState_Kind[BotPresenceState_Kind["FAILED"] = 6] = "FAILED";
|
|
6123
|
+
BotPresenceState_Kind[BotPresenceState_Kind["WAITING"] = 7] = "WAITING";
|
|
6124
|
+
BotPresenceState_Kind[BotPresenceState_Kind["RUNNING"] = 8] = "RUNNING";
|
|
6125
|
+
BotPresenceState_Kind[BotPresenceState_Kind["REVIEW"] = 9] = "REVIEW";
|
|
6083
6126
|
})(BotPresenceState_Kind || (BotPresenceState_Kind = {}));
|
|
6084
6127
|
var MessageSubthread_Kind;
|
|
6085
|
-
(function(
|
|
6086
|
-
|
|
6087
|
-
|
|
6088
|
-
|
|
6128
|
+
(function(MessageSubthread_Kind) {
|
|
6129
|
+
MessageSubthread_Kind[MessageSubthread_Kind["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6130
|
+
MessageSubthread_Kind[MessageSubthread_Kind["REPLY"] = 1] = "REPLY";
|
|
6131
|
+
MessageSubthread_Kind[MessageSubthread_Kind["SUBTHREAD"] = 2] = "SUBTHREAD";
|
|
6089
6132
|
})(MessageSubthread_Kind || (MessageSubthread_Kind = {}));
|
|
6090
6133
|
var BlockList_Kind;
|
|
6091
|
-
(function(
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6134
|
+
(function(BlockList_Kind) {
|
|
6135
|
+
BlockList_Kind[BlockList_Kind["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6136
|
+
BlockList_Kind[BlockList_Kind["UNORDERED"] = 1] = "UNORDERED";
|
|
6137
|
+
BlockList_Kind[BlockList_Kind["ORDERED"] = 2] = "ORDERED";
|
|
6095
6138
|
})(BlockList_Kind || (BlockList_Kind = {}));
|
|
6096
6139
|
var BlockDisclosure_Kind;
|
|
6097
|
-
(function(
|
|
6098
|
-
|
|
6099
|
-
|
|
6140
|
+
(function(BlockDisclosure_Kind) {
|
|
6141
|
+
BlockDisclosure_Kind[BlockDisclosure_Kind["DEFAULT"] = 0] = "DEFAULT";
|
|
6142
|
+
BlockDisclosure_Kind[BlockDisclosure_Kind["PROGRESS"] = 1] = "PROGRESS";
|
|
6100
6143
|
})(BlockDisclosure_Kind || (BlockDisclosure_Kind = {}));
|
|
6101
6144
|
var BlockDisclosure_ActivityKind;
|
|
6102
|
-
(function(
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
|
|
6107
|
-
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
|
|
6113
|
-
|
|
6114
|
-
|
|
6145
|
+
(function(BlockDisclosure_ActivityKind) {
|
|
6146
|
+
BlockDisclosure_ActivityKind[BlockDisclosure_ActivityKind["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6147
|
+
BlockDisclosure_ActivityKind[BlockDisclosure_ActivityKind["REASONING"] = 1] = "REASONING";
|
|
6148
|
+
BlockDisclosure_ActivityKind[BlockDisclosure_ActivityKind["EXPLORE"] = 2] = "EXPLORE";
|
|
6149
|
+
BlockDisclosure_ActivityKind[BlockDisclosure_ActivityKind["READ"] = 3] = "READ";
|
|
6150
|
+
BlockDisclosure_ActivityKind[BlockDisclosure_ActivityKind["SEARCH"] = 4] = "SEARCH";
|
|
6151
|
+
BlockDisclosure_ActivityKind[BlockDisclosure_ActivityKind["EDIT"] = 5] = "EDIT";
|
|
6152
|
+
BlockDisclosure_ActivityKind[BlockDisclosure_ActivityKind["DELETE"] = 6] = "DELETE";
|
|
6153
|
+
BlockDisclosure_ActivityKind[BlockDisclosure_ActivityKind["MOVE"] = 7] = "MOVE";
|
|
6154
|
+
BlockDisclosure_ActivityKind[BlockDisclosure_ActivityKind["COMMAND"] = 8] = "COMMAND";
|
|
6155
|
+
BlockDisclosure_ActivityKind[BlockDisclosure_ActivityKind["WEB"] = 9] = "WEB";
|
|
6156
|
+
BlockDisclosure_ActivityKind[BlockDisclosure_ActivityKind["TOOL"] = 10] = "TOOL";
|
|
6157
|
+
BlockDisclosure_ActivityKind[BlockDisclosure_ActivityKind["AGENT"] = 11] = "AGENT";
|
|
6115
6158
|
})(BlockDisclosure_ActivityKind || (BlockDisclosure_ActivityKind = {}));
|
|
6116
6159
|
var BlockTable_Alignment;
|
|
6117
|
-
(function(
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
|
|
6121
|
-
|
|
6160
|
+
(function(BlockTable_Alignment) {
|
|
6161
|
+
BlockTable_Alignment[BlockTable_Alignment["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6162
|
+
BlockTable_Alignment[BlockTable_Alignment["LEFT"] = 1] = "LEFT";
|
|
6163
|
+
BlockTable_Alignment[BlockTable_Alignment["CENTER"] = 2] = "CENTER";
|
|
6164
|
+
BlockTable_Alignment[BlockTable_Alignment["RIGHT"] = 3] = "RIGHT";
|
|
6122
6165
|
})(BlockTable_Alignment || (BlockTable_Alignment = {}));
|
|
6123
6166
|
var MessageEntity_Type;
|
|
6124
|
-
(function(
|
|
6125
|
-
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6167
|
+
(function(MessageEntity_Type) {
|
|
6168
|
+
MessageEntity_Type[MessageEntity_Type["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6169
|
+
MessageEntity_Type[MessageEntity_Type["MENTION"] = 1] = "MENTION";
|
|
6170
|
+
MessageEntity_Type[MessageEntity_Type["URL"] = 2] = "URL";
|
|
6171
|
+
MessageEntity_Type[MessageEntity_Type["TEXT_URL"] = 3] = "TEXT_URL";
|
|
6172
|
+
MessageEntity_Type[MessageEntity_Type["EMAIL"] = 4] = "EMAIL";
|
|
6173
|
+
MessageEntity_Type[MessageEntity_Type["BOLD"] = 5] = "BOLD";
|
|
6174
|
+
MessageEntity_Type[MessageEntity_Type["ITALIC"] = 6] = "ITALIC";
|
|
6175
|
+
MessageEntity_Type[MessageEntity_Type["USERNAME_MENTION"] = 7] = "USERNAME_MENTION";
|
|
6176
|
+
MessageEntity_Type[MessageEntity_Type["CODE"] = 8] = "CODE";
|
|
6177
|
+
MessageEntity_Type[MessageEntity_Type["PRE"] = 9] = "PRE";
|
|
6178
|
+
MessageEntity_Type[MessageEntity_Type["PHONE_NUMBER"] = 10] = "PHONE_NUMBER";
|
|
6179
|
+
MessageEntity_Type[MessageEntity_Type["THREAD"] = 11] = "THREAD";
|
|
6180
|
+
MessageEntity_Type[MessageEntity_Type["THREAD_TITLE"] = 12] = "THREAD_TITLE";
|
|
6181
|
+
MessageEntity_Type[MessageEntity_Type["BOT_COMMAND"] = 13] = "BOT_COMMAND";
|
|
6182
|
+
MessageEntity_Type[MessageEntity_Type["GROUP_MENTION"] = 14] = "GROUP_MENTION";
|
|
6183
|
+
MessageEntity_Type[MessageEntity_Type["UNDERLINE"] = 15] = "UNDERLINE";
|
|
6184
|
+
MessageEntity_Type[MessageEntity_Type["STRIKETHROUGH"] = 16] = "STRIKETHROUGH";
|
|
6185
|
+
MessageEntity_Type[MessageEntity_Type["HIGHLIGHT"] = 17] = "HIGHLIGHT";
|
|
6186
|
+
MessageEntity_Type[MessageEntity_Type["MATH"] = 18] = "MATH";
|
|
6144
6187
|
})(MessageEntity_Type || (MessageEntity_Type = {}));
|
|
6145
6188
|
var Member_Role;
|
|
6146
|
-
(function(
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
|
|
6189
|
+
(function(Member_Role) {
|
|
6190
|
+
Member_Role[Member_Role["OWNER"] = 0] = "OWNER";
|
|
6191
|
+
Member_Role[Member_Role["ADMIN"] = 1] = "ADMIN";
|
|
6192
|
+
Member_Role[Member_Role["MEMBER"] = 2] = "MEMBER";
|
|
6150
6193
|
})(Member_Role || (Member_Role = {}));
|
|
6151
6194
|
var UrlPreview_MediaType;
|
|
6152
|
-
(function(
|
|
6153
|
-
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6195
|
+
(function(UrlPreview_MediaType) {
|
|
6196
|
+
UrlPreview_MediaType[UrlPreview_MediaType["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6197
|
+
UrlPreview_MediaType[UrlPreview_MediaType["ARTICLE"] = 1] = "ARTICLE";
|
|
6198
|
+
UrlPreview_MediaType[UrlPreview_MediaType["IMAGE"] = 2] = "IMAGE";
|
|
6199
|
+
UrlPreview_MediaType[UrlPreview_MediaType["VIDEO"] = 3] = "VIDEO";
|
|
6200
|
+
UrlPreview_MediaType[UrlPreview_MediaType["DOCUMENT"] = 4] = "DOCUMENT";
|
|
6201
|
+
UrlPreview_MediaType[UrlPreview_MediaType["EMBED"] = 5] = "EMBED";
|
|
6159
6202
|
})(UrlPreview_MediaType || (UrlPreview_MediaType = {}));
|
|
6160
6203
|
var MessageAttachmentExternalTask_Status;
|
|
6161
|
-
(function(
|
|
6162
|
-
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6204
|
+
(function(MessageAttachmentExternalTask_Status) {
|
|
6205
|
+
MessageAttachmentExternalTask_Status[MessageAttachmentExternalTask_Status["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6206
|
+
MessageAttachmentExternalTask_Status[MessageAttachmentExternalTask_Status["BACKLOG"] = 1] = "BACKLOG";
|
|
6207
|
+
MessageAttachmentExternalTask_Status[MessageAttachmentExternalTask_Status["TODO"] = 2] = "TODO";
|
|
6208
|
+
MessageAttachmentExternalTask_Status[MessageAttachmentExternalTask_Status["IN_PROGRESS"] = 3] = "IN_PROGRESS";
|
|
6209
|
+
MessageAttachmentExternalTask_Status[MessageAttachmentExternalTask_Status["DONE"] = 4] = "DONE";
|
|
6210
|
+
MessageAttachmentExternalTask_Status[MessageAttachmentExternalTask_Status["CANCELLED"] = 5] = "CANCELLED";
|
|
6168
6211
|
})(MessageAttachmentExternalTask_Status || (MessageAttachmentExternalTask_Status = {}));
|
|
6169
6212
|
var Photo_Format;
|
|
6170
|
-
(function(
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6213
|
+
(function(Photo_Format) {
|
|
6214
|
+
Photo_Format[Photo_Format["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6215
|
+
Photo_Format[Photo_Format["JPEG"] = 1] = "JPEG";
|
|
6216
|
+
Photo_Format[Photo_Format["PNG"] = 2] = "PNG";
|
|
6174
6217
|
})(Photo_Format || (Photo_Format = {}));
|
|
6175
6218
|
var RpcError_Code;
|
|
6176
|
-
(function(
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
|
|
6187
|
-
|
|
6188
|
-
|
|
6189
|
-
|
|
6190
|
-
|
|
6191
|
-
|
|
6192
|
-
|
|
6193
|
-
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6219
|
+
(function(RpcError_Code) {
|
|
6220
|
+
RpcError_Code[RpcError_Code["UNKNOWN"] = 0] = "UNKNOWN";
|
|
6221
|
+
RpcError_Code[RpcError_Code["BAD_REQUEST"] = 1] = "BAD_REQUEST";
|
|
6222
|
+
RpcError_Code[RpcError_Code["UNAUTHENTICATED"] = 2] = "UNAUTHENTICATED";
|
|
6223
|
+
RpcError_Code[RpcError_Code["RATE_LIMIT"] = 3] = "RATE_LIMIT";
|
|
6224
|
+
RpcError_Code[RpcError_Code["INTERNAL_ERROR"] = 4] = "INTERNAL_ERROR";
|
|
6225
|
+
RpcError_Code[RpcError_Code["PEER_ID_INVALID"] = 5] = "PEER_ID_INVALID";
|
|
6226
|
+
RpcError_Code[RpcError_Code["MESSAGE_ID_INVALID"] = 6] = "MESSAGE_ID_INVALID";
|
|
6227
|
+
RpcError_Code[RpcError_Code["USER_ID_INVALID"] = 7] = "USER_ID_INVALID";
|
|
6228
|
+
RpcError_Code[RpcError_Code["USER_ALREADY_MEMBER"] = 8] = "USER_ALREADY_MEMBER";
|
|
6229
|
+
RpcError_Code[RpcError_Code["SPACE_ID_INVALID"] = 9] = "SPACE_ID_INVALID";
|
|
6230
|
+
RpcError_Code[RpcError_Code["CHAT_ID_INVALID"] = 10] = "CHAT_ID_INVALID";
|
|
6231
|
+
RpcError_Code[RpcError_Code["EMAIL_INVALID"] = 11] = "EMAIL_INVALID";
|
|
6232
|
+
RpcError_Code[RpcError_Code["PHONE_NUMBER_INVALID"] = 12] = "PHONE_NUMBER_INVALID";
|
|
6233
|
+
RpcError_Code[RpcError_Code["SPACE_ADMIN_REQUIRED"] = 13] = "SPACE_ADMIN_REQUIRED";
|
|
6234
|
+
RpcError_Code[RpcError_Code["SPACE_OWNER_REQUIRED"] = 14] = "SPACE_OWNER_REQUIRED";
|
|
6235
|
+
RpcError_Code[RpcError_Code["USERNAME_INVALID"] = 15] = "USERNAME_INVALID";
|
|
6236
|
+
RpcError_Code[RpcError_Code["USERNAME_TAKEN"] = 16] = "USERNAME_TAKEN";
|
|
6237
|
+
RpcError_Code[RpcError_Code["FIRST_NAME_INVALID"] = 17] = "FIRST_NAME_INVALID";
|
|
6238
|
+
RpcError_Code[RpcError_Code["URL_PREVIEW_UNAVAILABLE"] = 18] = "URL_PREVIEW_UNAVAILABLE";
|
|
6239
|
+
RpcError_Code[RpcError_Code["AGENT_SESSION_MESSAGE_IMMUTABLE"] = 19] = "AGENT_SESSION_MESSAGE_IMMUTABLE";
|
|
6240
|
+
RpcError_Code[RpcError_Code["SPACE_INVITE_INVALID"] = 20] = "SPACE_INVITE_INVALID";
|
|
6198
6241
|
})(RpcError_Code || (RpcError_Code = {}));
|
|
6199
6242
|
var SyncSkippedSequence_Reason;
|
|
6200
|
-
(function(
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
|
|
6243
|
+
(function(SyncSkippedSequence_Reason) {
|
|
6244
|
+
SyncSkippedSequence_Reason[SyncSkippedSequence_Reason["REASON_UNSPECIFIED"] = 0] = "REASON_UNSPECIFIED";
|
|
6245
|
+
SyncSkippedSequence_Reason[SyncSkippedSequence_Reason["IRRELEVANT_TO_BUCKET"] = 1] = "IRRELEVANT_TO_BUCKET";
|
|
6246
|
+
SyncSkippedSequence_Reason[SyncSkippedSequence_Reason["SNAPSHOT_REPAIR_REQUIRED"] = 2] = "SNAPSHOT_REPAIR_REQUIRED";
|
|
6204
6247
|
})(SyncSkippedSequence_Reason || (SyncSkippedSequence_Reason = {}));
|
|
6205
6248
|
var GetUpdatesResult_ResultType;
|
|
6206
|
-
(function(
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6249
|
+
(function(GetUpdatesResult_ResultType) {
|
|
6250
|
+
GetUpdatesResult_ResultType[GetUpdatesResult_ResultType["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6251
|
+
GetUpdatesResult_ResultType[GetUpdatesResult_ResultType["EMPTY"] = 1] = "EMPTY";
|
|
6252
|
+
GetUpdatesResult_ResultType[GetUpdatesResult_ResultType["SLICE"] = 2] = "SLICE";
|
|
6253
|
+
GetUpdatesResult_ResultType[GetUpdatesResult_ResultType["TOO_LONG"] = 3] = "TOO_LONG";
|
|
6211
6254
|
})(GetUpdatesResult_ResultType || (GetUpdatesResult_ResultType = {}));
|
|
6212
6255
|
var NotificationSettings_Mode;
|
|
6213
|
-
(function(
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
|
|
6219
|
-
|
|
6256
|
+
(function(NotificationSettings_Mode) {
|
|
6257
|
+
NotificationSettings_Mode[NotificationSettings_Mode["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6258
|
+
NotificationSettings_Mode[NotificationSettings_Mode["ALL"] = 1] = "ALL";
|
|
6259
|
+
NotificationSettings_Mode[NotificationSettings_Mode["NONE"] = 2] = "NONE";
|
|
6260
|
+
NotificationSettings_Mode[NotificationSettings_Mode["MENTIONS"] = 3] = "MENTIONS";
|
|
6261
|
+
NotificationSettings_Mode[NotificationSettings_Mode["IMPORTANT_ONLY"] = 4] = "IMPORTANT_ONLY";
|
|
6262
|
+
NotificationSettings_Mode[NotificationSettings_Mode["ONLY_MENTIONS"] = 5] = "ONLY_MENTIONS";
|
|
6220
6263
|
})(NotificationSettings_Mode || (NotificationSettings_Mode = {}));
|
|
6221
6264
|
var DialogNotificationSettings_Mode;
|
|
6222
|
-
(function(
|
|
6223
|
-
|
|
6224
|
-
|
|
6225
|
-
|
|
6226
|
-
|
|
6265
|
+
(function(DialogNotificationSettings_Mode) {
|
|
6266
|
+
DialogNotificationSettings_Mode[DialogNotificationSettings_Mode["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6267
|
+
DialogNotificationSettings_Mode[DialogNotificationSettings_Mode["ALL"] = 1] = "ALL";
|
|
6268
|
+
DialogNotificationSettings_Mode[DialogNotificationSettings_Mode["MENTIONS"] = 2] = "MENTIONS";
|
|
6269
|
+
DialogNotificationSettings_Mode[DialogNotificationSettings_Mode["NONE"] = 3] = "NONE";
|
|
6227
6270
|
})(DialogNotificationSettings_Mode || (DialogNotificationSettings_Mode = {}));
|
|
6228
6271
|
var PushContentEncryptionKey_Algorithm;
|
|
6229
|
-
(function(
|
|
6230
|
-
|
|
6231
|
-
|
|
6272
|
+
(function(PushContentEncryptionKey_Algorithm) {
|
|
6273
|
+
PushContentEncryptionKey_Algorithm[PushContentEncryptionKey_Algorithm["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6274
|
+
PushContentEncryptionKey_Algorithm[PushContentEncryptionKey_Algorithm["X25519_HKDF_SHA256_AES256_GCM"] = 1] = "X25519_HKDF_SHA256_AES256_GCM";
|
|
6232
6275
|
})(PushContentEncryptionKey_Algorithm || (PushContentEncryptionKey_Algorithm = {}));
|
|
6233
6276
|
var GetChatTranscriptInput_Mode;
|
|
6234
|
-
(function(
|
|
6235
|
-
|
|
6236
|
-
|
|
6277
|
+
(function(GetChatTranscriptInput_Mode) {
|
|
6278
|
+
GetChatTranscriptInput_Mode[GetChatTranscriptInput_Mode["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6279
|
+
GetChatTranscriptInput_Mode[GetChatTranscriptInput_Mode["HUMAN_READABLE"] = 1] = "HUMAN_READABLE";
|
|
6237
6280
|
})(GetChatTranscriptInput_Mode || (GetChatTranscriptInput_Mode = {}));
|
|
6238
6281
|
var GetChatTranscriptInput_Length;
|
|
6239
|
-
(function(
|
|
6240
|
-
|
|
6241
|
-
|
|
6282
|
+
(function(GetChatTranscriptInput_Length) {
|
|
6283
|
+
GetChatTranscriptInput_Length[GetChatTranscriptInput_Length["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6284
|
+
GetChatTranscriptInput_Length[GetChatTranscriptInput_Length["CONCISE"] = 1] = "CONCISE";
|
|
6242
6285
|
})(GetChatTranscriptInput_Length || (GetChatTranscriptInput_Length = {}));
|
|
6243
6286
|
var GetChatTranscriptInput_Media;
|
|
6244
|
-
(function(
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
|
|
6287
|
+
(function(GetChatTranscriptInput_Media) {
|
|
6288
|
+
GetChatTranscriptInput_Media[GetChatTranscriptInput_Media["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6289
|
+
GetChatTranscriptInput_Media[GetChatTranscriptInput_Media["INCLUDED"] = 1] = "INCLUDED";
|
|
6290
|
+
GetChatTranscriptInput_Media[GetChatTranscriptInput_Media["EXCLUDED"] = 2] = "EXCLUDED";
|
|
6248
6291
|
})(GetChatTranscriptInput_Media || (GetChatTranscriptInput_Media = {}));
|
|
6249
6292
|
var GetChatTranscriptResult_StopReason;
|
|
6250
|
-
(function(
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
|
|
6293
|
+
(function(GetChatTranscriptResult_StopReason) {
|
|
6294
|
+
GetChatTranscriptResult_StopReason[GetChatTranscriptResult_StopReason["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6295
|
+
GetChatTranscriptResult_StopReason[GetChatTranscriptResult_StopReason["COMPLETE"] = 1] = "COMPLETE";
|
|
6296
|
+
GetChatTranscriptResult_StopReason[GetChatTranscriptResult_StopReason["MESSAGE_LIMIT"] = 2] = "MESSAGE_LIMIT";
|
|
6297
|
+
GetChatTranscriptResult_StopReason[GetChatTranscriptResult_StopReason["OUTPUT_LIMIT"] = 3] = "OUTPUT_LIMIT";
|
|
6255
6298
|
})(GetChatTranscriptResult_StopReason || (GetChatTranscriptResult_StopReason = {}));
|
|
6256
6299
|
var UpdateNewMessageNotification_Reason;
|
|
6257
|
-
(function(
|
|
6258
|
-
|
|
6259
|
-
|
|
6260
|
-
|
|
6300
|
+
(function(UpdateNewMessageNotification_Reason) {
|
|
6301
|
+
UpdateNewMessageNotification_Reason[UpdateNewMessageNotification_Reason["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6302
|
+
UpdateNewMessageNotification_Reason[UpdateNewMessageNotification_Reason["MENTION"] = 1] = "MENTION";
|
|
6303
|
+
UpdateNewMessageNotification_Reason[UpdateNewMessageNotification_Reason["IMPORTANT"] = 2] = "IMPORTANT";
|
|
6261
6304
|
})(UpdateNewMessageNotification_Reason || (UpdateNewMessageNotification_Reason = {}));
|
|
6262
6305
|
var UpdateComposeAction_ComposeAction;
|
|
6263
|
-
(function(
|
|
6264
|
-
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6306
|
+
(function(UpdateComposeAction_ComposeAction) {
|
|
6307
|
+
UpdateComposeAction_ComposeAction[UpdateComposeAction_ComposeAction["NONE"] = 0] = "NONE";
|
|
6308
|
+
UpdateComposeAction_ComposeAction[UpdateComposeAction_ComposeAction["TYPING"] = 1] = "TYPING";
|
|
6309
|
+
UpdateComposeAction_ComposeAction[UpdateComposeAction_ComposeAction["UPLOADING_PHOTO"] = 2] = "UPLOADING_PHOTO";
|
|
6310
|
+
UpdateComposeAction_ComposeAction[UpdateComposeAction_ComposeAction["UPLOADING_DOCUMENT"] = 3] = "UPLOADING_DOCUMENT";
|
|
6311
|
+
UpdateComposeAction_ComposeAction[UpdateComposeAction_ComposeAction["UPLOADING_VIDEO"] = 4] = "UPLOADING_VIDEO";
|
|
6312
|
+
UpdateComposeAction_ComposeAction[UpdateComposeAction_ComposeAction["RECORDING_VOICE"] = 5] = "RECORDING_VOICE";
|
|
6313
|
+
UpdateComposeAction_ComposeAction[UpdateComposeAction_ComposeAction["WORKING"] = 6] = "WORKING";
|
|
6271
6314
|
})(UpdateComposeAction_ComposeAction || (UpdateComposeAction_ComposeAction = {}));
|
|
6272
6315
|
var UserStatus_Status;
|
|
6273
|
-
(function(
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6316
|
+
(function(UserStatus_Status) {
|
|
6317
|
+
UserStatus_Status[UserStatus_Status["UNKNOWN"] = 0] = "UNKNOWN";
|
|
6318
|
+
UserStatus_Status[UserStatus_Status["ONLINE"] = 1] = "ONLINE";
|
|
6319
|
+
UserStatus_Status[UserStatus_Status["OFFLINE"] = 2] = "OFFLINE";
|
|
6277
6320
|
})(UserStatus_Status || (UserStatus_Status = {}));
|
|
6278
6321
|
var BotCapability_Kind;
|
|
6279
|
-
(function(
|
|
6280
|
-
|
|
6281
|
-
|
|
6282
|
-
|
|
6322
|
+
(function(BotCapability_Kind) {
|
|
6323
|
+
BotCapability_Kind[BotCapability_Kind["KIND_UNSPECIFIED"] = 0] = "KIND_UNSPECIFIED";
|
|
6324
|
+
BotCapability_Kind[BotCapability_Kind["CHAT_SETTINGS"] = 1] = "CHAT_SETTINGS";
|
|
6325
|
+
BotCapability_Kind[BotCapability_Kind["AGENT_CONFIGURATION"] = 2] = "AGENT_CONFIGURATION";
|
|
6283
6326
|
})(BotCapability_Kind || (BotCapability_Kind = {}));
|
|
6284
6327
|
var BotChatSettingsInfo_Tone;
|
|
6285
|
-
(function(
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
|
|
6289
|
-
|
|
6290
|
-
|
|
6328
|
+
(function(BotChatSettingsInfo_Tone) {
|
|
6329
|
+
BotChatSettingsInfo_Tone[BotChatSettingsInfo_Tone["TONE_UNSPECIFIED"] = 0] = "TONE_UNSPECIFIED";
|
|
6330
|
+
BotChatSettingsInfo_Tone[BotChatSettingsInfo_Tone["NEUTRAL"] = 1] = "NEUTRAL";
|
|
6331
|
+
BotChatSettingsInfo_Tone[BotChatSettingsInfo_Tone["SUCCESS"] = 2] = "SUCCESS";
|
|
6332
|
+
BotChatSettingsInfo_Tone[BotChatSettingsInfo_Tone["WARNING"] = 3] = "WARNING";
|
|
6333
|
+
BotChatSettingsInfo_Tone[BotChatSettingsInfo_Tone["ERROR"] = 4] = "ERROR";
|
|
6291
6334
|
})(BotChatSettingsInfo_Tone || (BotChatSettingsInfo_Tone = {}));
|
|
6292
6335
|
var BotChatSettingsProblem_Code;
|
|
6293
|
-
(function(
|
|
6294
|
-
|
|
6295
|
-
|
|
6296
|
-
|
|
6297
|
-
|
|
6298
|
-
|
|
6299
|
-
|
|
6336
|
+
(function(BotChatSettingsProblem_Code) {
|
|
6337
|
+
BotChatSettingsProblem_Code[BotChatSettingsProblem_Code["CODE_UNSPECIFIED"] = 0] = "CODE_UNSPECIFIED";
|
|
6338
|
+
BotChatSettingsProblem_Code[BotChatSettingsProblem_Code["UNAVAILABLE"] = 1] = "UNAVAILABLE";
|
|
6339
|
+
BotChatSettingsProblem_Code[BotChatSettingsProblem_Code["INVALID_VALUE"] = 2] = "INVALID_VALUE";
|
|
6340
|
+
BotChatSettingsProblem_Code[BotChatSettingsProblem_Code["STALE"] = 3] = "STALE";
|
|
6341
|
+
BotChatSettingsProblem_Code[BotChatSettingsProblem_Code["FAILED"] = 4] = "FAILED";
|
|
6342
|
+
BotChatSettingsProblem_Code[BotChatSettingsProblem_Code["UNREACHABLE"] = 5] = "UNREACHABLE";
|
|
6300
6343
|
})(BotChatSettingsProblem_Code || (BotChatSettingsProblem_Code = {}));
|
|
6301
6344
|
var AuthBeginResult_Delivery;
|
|
6302
|
-
(function(
|
|
6303
|
-
|
|
6304
|
-
|
|
6305
|
-
|
|
6345
|
+
(function(AuthBeginResult_Delivery) {
|
|
6346
|
+
AuthBeginResult_Delivery[AuthBeginResult_Delivery["DELIVERY_UNSPECIFIED"] = 0] = "DELIVERY_UNSPECIFIED";
|
|
6347
|
+
AuthBeginResult_Delivery[AuthBeginResult_Delivery["EMAIL"] = 1] = "EMAIL";
|
|
6348
|
+
AuthBeginResult_Delivery[AuthBeginResult_Delivery["SMS"] = 2] = "SMS";
|
|
6306
6349
|
})(AuthBeginResult_Delivery || (AuthBeginResult_Delivery = {}));
|
|
6307
6350
|
var UploadFailure_Code;
|
|
6308
|
-
(function(
|
|
6309
|
-
|
|
6310
|
-
|
|
6311
|
-
|
|
6312
|
-
|
|
6313
|
-
|
|
6351
|
+
(function(UploadFailure_Code) {
|
|
6352
|
+
UploadFailure_Code[UploadFailure_Code["UPLOAD_FAILURE_CODE_UNSPECIFIED"] = 0] = "UPLOAD_FAILURE_CODE_UNSPECIFIED";
|
|
6353
|
+
UploadFailure_Code[UploadFailure_Code["UPLOAD_FAILURE_INTEGRITY"] = 1] = "UPLOAD_FAILURE_INTEGRITY";
|
|
6354
|
+
UploadFailure_Code[UploadFailure_Code["UPLOAD_FAILURE_INVALID_MEDIA"] = 2] = "UPLOAD_FAILURE_INVALID_MEDIA";
|
|
6355
|
+
UploadFailure_Code[UploadFailure_Code["UPLOAD_FAILURE_PROCESSING"] = 3] = "UPLOAD_FAILURE_PROCESSING";
|
|
6356
|
+
UploadFailure_Code[UploadFailure_Code["UPLOAD_FAILURE_STORAGE"] = 4] = "UPLOAD_FAILURE_STORAGE";
|
|
6314
6357
|
})(UploadFailure_Code || (UploadFailure_Code = {}));
|
|
6315
6358
|
var RequestBotFilesystemInput_Operation;
|
|
6316
|
-
(function(
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
|
|
6359
|
+
(function(RequestBotFilesystemInput_Operation) {
|
|
6360
|
+
RequestBotFilesystemInput_Operation[RequestBotFilesystemInput_Operation["OPERATION_UNSPECIFIED"] = 0] = "OPERATION_UNSPECIFIED";
|
|
6361
|
+
RequestBotFilesystemInput_Operation[RequestBotFilesystemInput_Operation["LIST"] = 1] = "LIST";
|
|
6362
|
+
RequestBotFilesystemInput_Operation[RequestBotFilesystemInput_Operation["REGISTER_FOLDER"] = 2] = "REGISTER_FOLDER";
|
|
6320
6363
|
})(RequestBotFilesystemInput_Operation || (RequestBotFilesystemInput_Operation = {}));
|
|
6321
6364
|
var BotFilesystemEntry_Kind;
|
|
6322
|
-
(function(
|
|
6323
|
-
|
|
6324
|
-
|
|
6325
|
-
|
|
6326
|
-
|
|
6327
|
-
|
|
6365
|
+
(function(BotFilesystemEntry_Kind) {
|
|
6366
|
+
BotFilesystemEntry_Kind[BotFilesystemEntry_Kind["KIND_UNSPECIFIED"] = 0] = "KIND_UNSPECIFIED";
|
|
6367
|
+
BotFilesystemEntry_Kind[BotFilesystemEntry_Kind["FILE"] = 1] = "FILE";
|
|
6368
|
+
BotFilesystemEntry_Kind[BotFilesystemEntry_Kind["DIRECTORY"] = 2] = "DIRECTORY";
|
|
6369
|
+
BotFilesystemEntry_Kind[BotFilesystemEntry_Kind["SYMLINK"] = 3] = "SYMLINK";
|
|
6370
|
+
BotFilesystemEntry_Kind[BotFilesystemEntry_Kind["OTHER"] = 4] = "OTHER";
|
|
6328
6371
|
})(BotFilesystemEntry_Kind || (BotFilesystemEntry_Kind = {}));
|
|
6329
6372
|
var DialogFollowMode;
|
|
6330
|
-
(function(
|
|
6331
|
-
|
|
6332
|
-
|
|
6333
|
-
|
|
6373
|
+
(function(DialogFollowMode) {
|
|
6374
|
+
DialogFollowMode[DialogFollowMode["DIALOG_FOLLOW_MODE_UNSPECIFIED"] = 0] = "DIALOG_FOLLOW_MODE_UNSPECIFIED";
|
|
6375
|
+
DialogFollowMode[DialogFollowMode["FOLLOWING"] = 1] = "FOLLOWING";
|
|
6376
|
+
DialogFollowMode[DialogFollowMode["UNFOLLOWED"] = 2] = "UNFOLLOWED";
|
|
6334
6377
|
})(DialogFollowMode || (DialogFollowMode = {}));
|
|
6335
6378
|
var GridTranscriptMessageKind;
|
|
6336
|
-
(function(
|
|
6337
|
-
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
|
|
6341
|
-
|
|
6379
|
+
(function(GridTranscriptMessageKind) {
|
|
6380
|
+
GridTranscriptMessageKind[GridTranscriptMessageKind["GRID_TRANSCRIPT_TURN"] = 0] = "GRID_TRANSCRIPT_TURN";
|
|
6381
|
+
GridTranscriptMessageKind[GridTranscriptMessageKind["GRID_TRANSCRIPT_STARTED"] = 1] = "GRID_TRANSCRIPT_STARTED";
|
|
6382
|
+
GridTranscriptMessageKind[GridTranscriptMessageKind["GRID_TRANSCRIPT_STOPPED"] = 2] = "GRID_TRANSCRIPT_STOPPED";
|
|
6383
|
+
GridTranscriptMessageKind[GridTranscriptMessageKind["GRID_TRANSCRIPT_INTERRUPTED"] = 3] = "GRID_TRANSCRIPT_INTERRUPTED";
|
|
6384
|
+
GridTranscriptMessageKind[GridTranscriptMessageKind["GRID_TRANSCRIPT_LINK"] = 4] = "GRID_TRANSCRIPT_LINK";
|
|
6342
6385
|
})(GridTranscriptMessageKind || (GridTranscriptMessageKind = {}));
|
|
6343
6386
|
var AgentSessionProvider;
|
|
6344
|
-
(function(
|
|
6345
|
-
|
|
6346
|
-
|
|
6347
|
-
|
|
6348
|
-
|
|
6349
|
-
|
|
6350
|
-
|
|
6387
|
+
(function(AgentSessionProvider) {
|
|
6388
|
+
AgentSessionProvider[AgentSessionProvider["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6389
|
+
AgentSessionProvider[AgentSessionProvider["CODEX"] = 1] = "CODEX";
|
|
6390
|
+
AgentSessionProvider[AgentSessionProvider["CODEX_CLOUD"] = 2] = "CODEX_CLOUD";
|
|
6391
|
+
AgentSessionProvider[AgentSessionProvider["CLAUDE"] = 3] = "CLAUDE";
|
|
6392
|
+
AgentSessionProvider[AgentSessionProvider["OPEN_CODE"] = 4] = "OPEN_CODE";
|
|
6393
|
+
AgentSessionProvider[AgentSessionProvider["AMP"] = 5] = "AMP";
|
|
6351
6394
|
})(AgentSessionProvider || (AgentSessionProvider = {}));
|
|
6352
6395
|
var AgentSessionMessageRole;
|
|
6353
|
-
(function(
|
|
6354
|
-
|
|
6355
|
-
|
|
6356
|
-
|
|
6396
|
+
(function(AgentSessionMessageRole) {
|
|
6397
|
+
AgentSessionMessageRole[AgentSessionMessageRole["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6398
|
+
AgentSessionMessageRole[AgentSessionMessageRole["USER"] = 1] = "USER";
|
|
6399
|
+
AgentSessionMessageRole[AgentSessionMessageRole["ASSISTANT"] = 2] = "ASSISTANT";
|
|
6357
6400
|
})(AgentSessionMessageRole || (AgentSessionMessageRole = {}));
|
|
6358
6401
|
var AgentSessionMessageRelation;
|
|
6359
|
-
(function(
|
|
6360
|
-
|
|
6361
|
-
|
|
6362
|
-
|
|
6402
|
+
(function(AgentSessionMessageRelation) {
|
|
6403
|
+
AgentSessionMessageRelation[AgentSessionMessageRelation["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6404
|
+
AgentSessionMessageRelation[AgentSessionMessageRelation["IMPORTED"] = 1] = "IMPORTED";
|
|
6405
|
+
AgentSessionMessageRelation[AgentSessionMessageRelation["LINKED"] = 2] = "LINKED";
|
|
6363
6406
|
})(AgentSessionMessageRelation || (AgentSessionMessageRelation = {}));
|
|
6364
6407
|
var MessageSendMode;
|
|
6365
|
-
(function(
|
|
6366
|
-
|
|
6367
|
-
|
|
6408
|
+
(function(MessageSendMode) {
|
|
6409
|
+
MessageSendMode[MessageSendMode["MODE_UNSPECIFIED"] = 0] = "MODE_UNSPECIFIED";
|
|
6410
|
+
MessageSendMode[MessageSendMode["MODE_SILENT"] = 1] = "MODE_SILENT";
|
|
6368
6411
|
})(MessageSendMode || (MessageSendMode = {}));
|
|
6369
6412
|
var ConnectAgentSessionState;
|
|
6370
|
-
(function(
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6413
|
+
(function(ConnectAgentSessionState) {
|
|
6414
|
+
ConnectAgentSessionState[ConnectAgentSessionState["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6415
|
+
ConnectAgentSessionState[ConnectAgentSessionState["CREATED"] = 1] = "CREATED";
|
|
6416
|
+
ConnectAgentSessionState[ConnectAgentSessionState["ALREADY_CONNECTED"] = 2] = "ALREADY_CONNECTED";
|
|
6417
|
+
ConnectAgentSessionState[ConnectAgentSessionState["CONNECTED_ELSEWHERE"] = 3] = "CONNECTED_ELSEWHERE";
|
|
6375
6418
|
})(ConnectAgentSessionState || (ConnectAgentSessionState = {}));
|
|
6376
6419
|
var AgentSessionSyncMode;
|
|
6377
|
-
(function(
|
|
6378
|
-
|
|
6379
|
-
|
|
6380
|
-
|
|
6420
|
+
(function(AgentSessionSyncMode) {
|
|
6421
|
+
AgentSessionSyncMode[AgentSessionSyncMode["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6422
|
+
AgentSessionSyncMode[AgentSessionSyncMode["HISTORY"] = 1] = "HISTORY";
|
|
6423
|
+
AgentSessionSyncMode[AgentSessionSyncMode["LIVE"] = 2] = "LIVE";
|
|
6381
6424
|
})(AgentSessionSyncMode || (AgentSessionSyncMode = {}));
|
|
6382
6425
|
var AgentSessionMessageSyncState;
|
|
6383
|
-
(function(
|
|
6384
|
-
|
|
6385
|
-
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6426
|
+
(function(AgentSessionMessageSyncState) {
|
|
6427
|
+
AgentSessionMessageSyncState[AgentSessionMessageSyncState["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6428
|
+
AgentSessionMessageSyncState[AgentSessionMessageSyncState["CREATED"] = 1] = "CREATED";
|
|
6429
|
+
AgentSessionMessageSyncState[AgentSessionMessageSyncState["EDITED"] = 2] = "EDITED";
|
|
6430
|
+
AgentSessionMessageSyncState[AgentSessionMessageSyncState["LINKED"] = 3] = "LINKED";
|
|
6431
|
+
AgentSessionMessageSyncState[AgentSessionMessageSyncState["UNCHANGED"] = 4] = "UNCHANGED";
|
|
6432
|
+
AgentSessionMessageSyncState[AgentSessionMessageSyncState["STALE"] = 5] = "STALE";
|
|
6433
|
+
AgentSessionMessageSyncState[AgentSessionMessageSyncState["TOMBSTONED"] = 6] = "TOMBSTONED";
|
|
6434
|
+
AgentSessionMessageSyncState[AgentSessionMessageSyncState["CONFLICT"] = 7] = "CONFLICT";
|
|
6392
6435
|
})(AgentSessionMessageSyncState || (AgentSessionMessageSyncState = {}));
|
|
6393
6436
|
var Method;
|
|
6394
|
-
(function(
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6418
|
-
|
|
6419
|
-
|
|
6420
|
-
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
|
|
6424
|
-
|
|
6425
|
-
|
|
6426
|
-
|
|
6427
|
-
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
|
|
6434
|
-
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
6444
|
-
|
|
6445
|
-
|
|
6446
|
-
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
|
|
6450
|
-
|
|
6451
|
-
|
|
6452
|
-
|
|
6453
|
-
|
|
6454
|
-
|
|
6455
|
-
|
|
6456
|
-
|
|
6457
|
-
|
|
6458
|
-
|
|
6459
|
-
|
|
6460
|
-
|
|
6461
|
-
|
|
6462
|
-
|
|
6463
|
-
|
|
6464
|
-
|
|
6465
|
-
|
|
6466
|
-
|
|
6467
|
-
|
|
6468
|
-
|
|
6469
|
-
|
|
6470
|
-
|
|
6471
|
-
|
|
6472
|
-
|
|
6473
|
-
|
|
6474
|
-
|
|
6475
|
-
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
|
|
6480
|
-
|
|
6481
|
-
|
|
6482
|
-
|
|
6483
|
-
|
|
6484
|
-
|
|
6485
|
-
|
|
6486
|
-
|
|
6487
|
-
|
|
6488
|
-
|
|
6489
|
-
|
|
6490
|
-
|
|
6491
|
-
|
|
6492
|
-
|
|
6493
|
-
|
|
6494
|
-
|
|
6495
|
-
|
|
6496
|
-
|
|
6497
|
-
|
|
6498
|
-
|
|
6499
|
-
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
|
|
6519
|
-
|
|
6520
|
-
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6437
|
+
(function(Method) {
|
|
6438
|
+
Method[Method["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6439
|
+
Method[Method["GET_ME"] = 1] = "GET_ME";
|
|
6440
|
+
Method[Method["SEND_MESSAGE"] = 2] = "SEND_MESSAGE";
|
|
6441
|
+
Method[Method["GET_PEER_PHOTO"] = 3] = "GET_PEER_PHOTO";
|
|
6442
|
+
Method[Method["DELETE_MESSAGES"] = 4] = "DELETE_MESSAGES";
|
|
6443
|
+
Method[Method["GET_CHAT_HISTORY"] = 5] = "GET_CHAT_HISTORY";
|
|
6444
|
+
Method[Method["ADD_REACTION"] = 6] = "ADD_REACTION";
|
|
6445
|
+
Method[Method["DELETE_REACTION"] = 7] = "DELETE_REACTION";
|
|
6446
|
+
Method[Method["EDIT_MESSAGE"] = 8] = "EDIT_MESSAGE";
|
|
6447
|
+
Method[Method["CREATE_CHAT"] = 9] = "CREATE_CHAT";
|
|
6448
|
+
Method[Method["GET_SPACE_MEMBERS"] = 10] = "GET_SPACE_MEMBERS";
|
|
6449
|
+
Method[Method["DELETE_CHAT"] = 11] = "DELETE_CHAT";
|
|
6450
|
+
Method[Method["INVITE_TO_SPACE"] = 12] = "INVITE_TO_SPACE";
|
|
6451
|
+
Method[Method["GET_CHAT_PARTICIPANTS"] = 13] = "GET_CHAT_PARTICIPANTS";
|
|
6452
|
+
Method[Method["ADD_CHAT_PARTICIPANT"] = 14] = "ADD_CHAT_PARTICIPANT";
|
|
6453
|
+
Method[Method["REMOVE_CHAT_PARTICIPANT"] = 15] = "REMOVE_CHAT_PARTICIPANT";
|
|
6454
|
+
Method[Method["TRANSLATE_MESSAGES"] = 16] = "TRANSLATE_MESSAGES";
|
|
6455
|
+
Method[Method["GET_CHATS"] = 17] = "GET_CHATS";
|
|
6456
|
+
Method[Method["UPDATE_USER_SETTINGS"] = 18] = "UPDATE_USER_SETTINGS";
|
|
6457
|
+
Method[Method["GET_USER_SETTINGS"] = 19] = "GET_USER_SETTINGS";
|
|
6458
|
+
Method[Method["SEND_COMPOSE_ACTION"] = 20] = "SEND_COMPOSE_ACTION";
|
|
6459
|
+
Method[Method["CREATE_BOT"] = 21] = "CREATE_BOT";
|
|
6460
|
+
Method[Method["DELETE_MEMBER"] = 22] = "DELETE_MEMBER";
|
|
6461
|
+
Method[Method["MARK_AS_UNREAD"] = 23] = "MARK_AS_UNREAD";
|
|
6462
|
+
Method[Method["GET_UPDATES_STATE"] = 24] = "GET_UPDATES_STATE";
|
|
6463
|
+
Method[Method["GET_CHAT"] = 25] = "GET_CHAT";
|
|
6464
|
+
Method[Method["GET_UPDATES"] = 26] = "GET_UPDATES";
|
|
6465
|
+
Method[Method["UPDATE_MEMBER_ACCESS"] = 27] = "UPDATE_MEMBER_ACCESS";
|
|
6466
|
+
Method[Method["SEARCH_MESSAGES"] = 28] = "SEARCH_MESSAGES";
|
|
6467
|
+
Method[Method["FORWARD_MESSAGES"] = 29] = "FORWARD_MESSAGES";
|
|
6468
|
+
Method[Method["UPDATE_CHAT_VISIBILITY"] = 30] = "UPDATE_CHAT_VISIBILITY";
|
|
6469
|
+
Method[Method["PIN_MESSAGE"] = 31] = "PIN_MESSAGE";
|
|
6470
|
+
Method[Method["UPDATE_CHAT_INFO"] = 32] = "UPDATE_CHAT_INFO";
|
|
6471
|
+
Method[Method["LIST_BOTS"] = 33] = "LIST_BOTS";
|
|
6472
|
+
Method[Method["REVEAL_BOT_TOKEN"] = 34] = "REVEAL_BOT_TOKEN";
|
|
6473
|
+
Method[Method["MOVE_THREAD"] = 35] = "MOVE_THREAD";
|
|
6474
|
+
Method[Method["ROTATE_BOT_TOKEN"] = 36] = "ROTATE_BOT_TOKEN";
|
|
6475
|
+
Method[Method["UPDATE_BOT_PROFILE"] = 37] = "UPDATE_BOT_PROFILE";
|
|
6476
|
+
Method[Method["GET_MESSAGES"] = 38] = "GET_MESSAGES";
|
|
6477
|
+
Method[Method["UPDATE_DIALOG_NOTIFICATION_SETTINGS"] = 39] = "UPDATE_DIALOG_NOTIFICATION_SETTINGS";
|
|
6478
|
+
Method[Method["READ_MESSAGES"] = 40] = "READ_MESSAGES";
|
|
6479
|
+
Method[Method["REGISTER_DEVICE"] = 41] = "REGISTER_DEVICE";
|
|
6480
|
+
Method[Method["CREATE_SUBTHREAD"] = 42] = "CREATE_SUBTHREAD";
|
|
6481
|
+
Method[Method["GET_BOT_COMMANDS"] = 43] = "GET_BOT_COMMANDS";
|
|
6482
|
+
Method[Method["SET_BOT_COMMANDS"] = 44] = "SET_BOT_COMMANDS";
|
|
6483
|
+
Method[Method["GET_PEER_BOT_COMMANDS"] = 45] = "GET_PEER_BOT_COMMANDS";
|
|
6484
|
+
Method[Method["SHOW_IN_CHAT_LIST"] = 46] = "SHOW_IN_CHAT_LIST";
|
|
6485
|
+
Method[Method["RESERVE_CHAT_IDS"] = 47] = "RESERVE_CHAT_IDS";
|
|
6486
|
+
Method[Method["INVOKE_MESSAGE_ACTION"] = 48] = "INVOKE_MESSAGE_ACTION";
|
|
6487
|
+
Method[Method["ANSWER_MESSAGE_ACTION"] = 49] = "ANSWER_MESSAGE_ACTION";
|
|
6488
|
+
Method[Method["REVOKE_SESSION"] = 50] = "REVOKE_SESSION";
|
|
6489
|
+
Method[Method["UPDATE_DIALOG_OPEN"] = 51] = "UPDATE_DIALOG_OPEN";
|
|
6490
|
+
Method[Method["UPDATE_DIALOG_ORDER"] = 52] = "UPDATE_DIALOG_ORDER";
|
|
6491
|
+
Method[Method["CLEAR_CHAT_HISTORY"] = 53] = "CLEAR_CHAT_HISTORY";
|
|
6492
|
+
Method[Method["DELETE_BOT"] = 54] = "DELETE_BOT";
|
|
6493
|
+
Method[Method["DELETE_MESSAGE_ATTACHMENT"] = 55] = "DELETE_MESSAGE_ATTACHMENT";
|
|
6494
|
+
Method[Method["SET_BOT_AVATAR"] = 56] = "SET_BOT_AVATAR";
|
|
6495
|
+
Method[Method["CLEAR_BOT_AVATAR"] = 57] = "CLEAR_BOT_AVATAR";
|
|
6496
|
+
Method[Method["GET_BOT_PRESENCE"] = 58] = "GET_BOT_PRESENCE";
|
|
6497
|
+
Method[Method["SET_BOT_PRESENCE_STATE"] = 59] = "SET_BOT_PRESENCE_STATE";
|
|
6498
|
+
Method[Method["UPDATE_DIALOG_FOLLOW_MODE"] = 60] = "UPDATE_DIALOG_FOLLOW_MODE";
|
|
6499
|
+
Method[Method["GET_SESSIONS"] = 61] = "GET_SESSIONS";
|
|
6500
|
+
Method[Method["CHECK_USERNAME"] = 62] = "CHECK_USERNAME";
|
|
6501
|
+
Method[Method["CHANGE_USERNAME"] = 63] = "CHANGE_USERNAME";
|
|
6502
|
+
Method[Method["UPDATE_PROFILE"] = 64] = "UPDATE_PROFILE";
|
|
6503
|
+
Method[Method["GET_SPACE_URL_PREVIEW_EXCLUSIONS"] = 65] = "GET_SPACE_URL_PREVIEW_EXCLUSIONS";
|
|
6504
|
+
Method[Method["ADD_SPACE_URL_PREVIEW_EXCLUSION"] = 66] = "ADD_SPACE_URL_PREVIEW_EXCLUSION";
|
|
6505
|
+
Method[Method["REMOVE_SPACE_URL_PREVIEW_EXCLUSION"] = 67] = "REMOVE_SPACE_URL_PREVIEW_EXCLUSION";
|
|
6506
|
+
Method[Method["GET_USER_GROUPS"] = 68] = "GET_USER_GROUPS";
|
|
6507
|
+
Method[Method["CREATE_USER_GROUP"] = 69] = "CREATE_USER_GROUP";
|
|
6508
|
+
Method[Method["UPDATE_USER_GROUP"] = 70] = "UPDATE_USER_GROUP";
|
|
6509
|
+
Method[Method["DELETE_USER_GROUP"] = 71] = "DELETE_USER_GROUP";
|
|
6510
|
+
Method[Method["GET_SPACE_SETTINGS"] = 72] = "GET_SPACE_SETTINGS";
|
|
6511
|
+
Method[Method["TOGGLE_SPACE_GRID"] = 73] = "TOGGLE_SPACE_GRID";
|
|
6512
|
+
Method[Method["GET_THREAD_REFERENCES"] = 74] = "GET_THREAD_REFERENCES";
|
|
6513
|
+
Method[Method["GET_THREAD_SUBTHREADS"] = 75] = "GET_THREAD_SUBTHREADS";
|
|
6514
|
+
Method[Method["GET_PEER_BOTS"] = 76] = "GET_PEER_BOTS";
|
|
6515
|
+
Method[Method["GET_MY_BOT_CAPABILITIES"] = 77] = "GET_MY_BOT_CAPABILITIES";
|
|
6516
|
+
Method[Method["SET_MY_BOT_CAPABILITIES"] = 78] = "SET_MY_BOT_CAPABILITIES";
|
|
6517
|
+
Method[Method["REQUEST_BOT_CHAT_SETTINGS"] = 79] = "REQUEST_BOT_CHAT_SETTINGS";
|
|
6518
|
+
Method[Method["INVOKE_BOT_CHAT_SETTINGS_ITEM"] = 80] = "INVOKE_BOT_CHAT_SETTINGS_ITEM";
|
|
6519
|
+
Method[Method["ANSWER_BOT_CHAT_SETTINGS"] = 81] = "ANSWER_BOT_CHAT_SETTINGS";
|
|
6520
|
+
Method[Method["GET_GRID"] = 83] = "GET_GRID";
|
|
6521
|
+
Method[Method["CREATE_GRID_ROOM"] = 84] = "CREATE_GRID_ROOM";
|
|
6522
|
+
Method[Method["JOIN_GRID_ROOM"] = 85] = "JOIN_GRID_ROOM";
|
|
6523
|
+
Method[Method["LEAVE_GRID_ROOM"] = 86] = "LEAVE_GRID_ROOM";
|
|
6524
|
+
Method[Method["SET_GRID_ROOM_TITLE"] = 87] = "SET_GRID_ROOM_TITLE";
|
|
6525
|
+
Method[Method["SET_GRID_ROOM_LOCKED"] = 88] = "SET_GRID_ROOM_LOCKED";
|
|
6526
|
+
Method[Method["DELETE_GRID_ROOM"] = 89] = "DELETE_GRID_ROOM";
|
|
6527
|
+
Method[Method["PREPARE_GRID_CONNECTION"] = 90] = "PREPARE_GRID_CONNECTION";
|
|
6528
|
+
Method[Method["SET_GRID_AVATAR_MICROPHONE_ENABLED"] = 91] = "SET_GRID_AVATAR_MICROPHONE_ENABLED";
|
|
6529
|
+
Method[Method["GET_GRID_HOME"] = 92] = "GET_GRID_HOME";
|
|
6530
|
+
Method[Method["CREATE_CLI_SESSION"] = 93] = "CREATE_CLI_SESSION";
|
|
6531
|
+
Method[Method["SET_PROFILE_PHOTO"] = 94] = "SET_PROFILE_PHOTO";
|
|
6532
|
+
Method[Method["GET_EXTERNAL_PROFILE_PHOTO"] = 95] = "GET_EXTERNAL_PROFILE_PHOTO";
|
|
6533
|
+
Method[Method["GET_CHAT_TRANSCRIPT"] = 96] = "GET_CHAT_TRANSCRIPT";
|
|
6534
|
+
Method[Method["SEARCH_EXTERNAL_RESOURCES"] = 97] = "SEARCH_EXTERNAL_RESOURCES";
|
|
6535
|
+
Method[Method["JOIN_PUBLIC_SPACE"] = 98] = "JOIN_PUBLIC_SPACE";
|
|
6536
|
+
Method[Method["COLLAPSE_HISTORY"] = 99] = "COLLAPSE_HISTORY";
|
|
6537
|
+
Method[Method["LIST_CONNECTORS"] = 100] = "LIST_CONNECTORS";
|
|
6538
|
+
Method[Method["PREPARE_CONNECTOR_OAUTH"] = 101] = "PREPARE_CONNECTOR_OAUTH";
|
|
6539
|
+
Method[Method["DISCONNECT_CONNECTOR"] = 102] = "DISCONNECT_CONNECTOR";
|
|
6540
|
+
Method[Method["SEARCH_USERS"] = 103] = "SEARCH_USERS";
|
|
6541
|
+
Method[Method["INVITE_TO_INLINE"] = 104] = "INVITE_TO_INLINE";
|
|
6542
|
+
Method[Method["RESOLVE_URL_PREVIEW"] = 105] = "RESOLVE_URL_PREVIEW";
|
|
6543
|
+
Method[Method["CREATE_BOT_AGENT"] = 106] = "CREATE_BOT_AGENT";
|
|
6544
|
+
Method[Method["GET_BOT_AGENT"] = 107] = "GET_BOT_AGENT";
|
|
6545
|
+
Method[Method["LIST_BOT_AGENTS"] = 108] = "LIST_BOT_AGENTS";
|
|
6546
|
+
Method[Method["CREATE_SPACE"] = 109] = "CREATE_SPACE";
|
|
6547
|
+
Method[Method["DELETE_SPACE"] = 110] = "DELETE_SPACE";
|
|
6548
|
+
Method[Method["LEAVE_SPACE"] = 111] = "LEAVE_SPACE";
|
|
6549
|
+
Method[Method["GET_CONNECTOR_CONFIG"] = 112] = "GET_CONNECTOR_CONFIG";
|
|
6550
|
+
Method[Method["SET_CONNECTOR_CONFIG"] = 113] = "SET_CONNECTOR_CONFIG";
|
|
6551
|
+
Method[Method["CREATE_EXTERNAL_TASK"] = 114] = "CREATE_EXTERNAL_TASK";
|
|
6552
|
+
Method[Method["UNREGISTER_DEVICE"] = 115] = "UNREGISTER_DEVICE";
|
|
6553
|
+
Method[Method["LOG_OUT"] = 116] = "LOG_OUT";
|
|
6554
|
+
Method[Method["CREATE_UPLOAD"] = 117] = "CREATE_UPLOAD";
|
|
6555
|
+
Method[Method["SAVE_UPLOAD_PART"] = 118] = "SAVE_UPLOAD_PART";
|
|
6556
|
+
Method[Method["GET_UPLOAD_STATE"] = 119] = "GET_UPLOAD_STATE";
|
|
6557
|
+
Method[Method["FINISH_UPLOAD"] = 120] = "FINISH_UPLOAD";
|
|
6558
|
+
Method[Method["CANCEL_UPLOAD"] = 121] = "CANCEL_UPLOAD";
|
|
6559
|
+
Method[Method["UPDATE_SESSION"] = 122] = "UPDATE_SESSION";
|
|
6560
|
+
Method[Method["UPDATE_DIALOG_ARCHIVED"] = 123] = "UPDATE_DIALOG_ARCHIVED";
|
|
6561
|
+
Method[Method["CREATE_DIALOG_FOLDER"] = 124] = "CREATE_DIALOG_FOLDER";
|
|
6562
|
+
Method[Method["UPDATE_DIALOG_FOLDER"] = 125] = "UPDATE_DIALOG_FOLDER";
|
|
6563
|
+
Method[Method["DELETE_DIALOG_FOLDER"] = 126] = "DELETE_DIALOG_FOLDER";
|
|
6564
|
+
Method[Method["GET_SPACE"] = 127] = "GET_SPACE";
|
|
6565
|
+
Method[Method["CONNECT_AGENT_SESSION"] = 128] = "CONNECT_AGENT_SESSION";
|
|
6566
|
+
Method[Method["SYNC_AGENT_SESSION_MESSAGES"] = 129] = "SYNC_AGENT_SESSION_MESSAGES";
|
|
6567
|
+
Method[Method["GET_AGENT_SESSION"] = 130] = "GET_AGENT_SESSION";
|
|
6568
|
+
Method[Method["UPDATE_BOT_AGENT"] = 131] = "UPDATE_BOT_AGENT";
|
|
6569
|
+
Method[Method["DELETE_BOT_AGENT"] = 132] = "DELETE_BOT_AGENT";
|
|
6570
|
+
Method[Method["JOIN_SPACE_BY_INVITE_TOKEN"] = 133] = "JOIN_SPACE_BY_INVITE_TOKEN";
|
|
6571
|
+
Method[Method["GET_SPACE_INVITE_LINK"] = 134] = "GET_SPACE_INVITE_LINK";
|
|
6572
|
+
Method[Method["SET_SPACE_INVITE_LINK_ENABLED"] = 135] = "SET_SPACE_INVITE_LINK_ENABLED";
|
|
6573
|
+
Method[Method["GET_FILE_PART"] = 136] = "GET_FILE_PART";
|
|
6574
|
+
Method[Method["ACKNOWLEDGE_MESSAGES"] = 137] = "ACKNOWLEDGE_MESSAGES";
|
|
6575
|
+
Method[Method["GET_USERS"] = 138] = "GET_USERS";
|
|
6576
|
+
Method[Method["GET_BOT_SKILLS"] = 139] = "GET_BOT_SKILLS";
|
|
6577
|
+
Method[Method["GET_BOT_CONFIGURATION_CATALOG"] = 140] = "GET_BOT_CONFIGURATION_CATALOG";
|
|
6578
|
+
Method[Method["UPDATE_DIALOG_TRANSLATION"] = 141] = "UPDATE_DIALOG_TRANSLATION";
|
|
6579
|
+
Method[Method["TRANSCRIBE_VOICE_DRAFT"] = 142] = "TRANSCRIBE_VOICE_DRAFT";
|
|
6580
|
+
Method[Method["REQUEST_BOT_FILESYSTEM"] = 143] = "REQUEST_BOT_FILESYSTEM";
|
|
6581
|
+
Method[Method["ANSWER_BOT_FILESYSTEM"] = 144] = "ANSWER_BOT_FILESYSTEM";
|
|
6582
|
+
Method[Method["SET_SPACE_PHOTO"] = 145] = "SET_SPACE_PHOTO";
|
|
6583
|
+
Method[Method["MOVE_GRID_CALL_HERE"] = 146] = "MOVE_GRID_CALL_HERE";
|
|
6584
|
+
Method[Method["OPEN_GRID_THREAD"] = 147] = "OPEN_GRID_THREAD";
|
|
6585
|
+
Method[Method["SET_GRID_TRANSCRIPTION"] = 148] = "SET_GRID_TRANSCRIPTION";
|
|
6586
|
+
Method[Method["LIST_GRID_TRANSCRIPTS"] = 149] = "LIST_GRID_TRANSCRIPTS";
|
|
6544
6587
|
})(Method || (Method = {}));
|
|
6545
6588
|
var GridTranscriptionState;
|
|
6546
|
-
(function(
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
|
|
6589
|
+
(function(GridTranscriptionState) {
|
|
6590
|
+
GridTranscriptionState[GridTranscriptionState["GRID_TRANSCRIPTION_UNSPECIFIED"] = 0] = "GRID_TRANSCRIPTION_UNSPECIFIED";
|
|
6591
|
+
GridTranscriptionState[GridTranscriptionState["GRID_TRANSCRIPTION_STARTING"] = 1] = "GRID_TRANSCRIPTION_STARTING";
|
|
6592
|
+
GridTranscriptionState[GridTranscriptionState["GRID_TRANSCRIPTION_ACTIVE"] = 2] = "GRID_TRANSCRIPTION_ACTIVE";
|
|
6593
|
+
GridTranscriptionState[GridTranscriptionState["GRID_TRANSCRIPTION_STOPPING"] = 3] = "GRID_TRANSCRIPTION_STOPPING";
|
|
6594
|
+
GridTranscriptionState[GridTranscriptionState["GRID_TRANSCRIPTION_STOPPED"] = 4] = "GRID_TRANSCRIPTION_STOPPED";
|
|
6595
|
+
GridTranscriptionState[GridTranscriptionState["GRID_TRANSCRIPTION_INTERRUPTED"] = 5] = "GRID_TRANSCRIPTION_INTERRUPTED";
|
|
6553
6596
|
})(GridTranscriptionState || (GridTranscriptionState = {}));
|
|
6554
6597
|
var GridTranscriptDestination;
|
|
6555
|
-
(function(
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6598
|
+
(function(GridTranscriptDestination) {
|
|
6599
|
+
GridTranscriptDestination[GridTranscriptDestination["GRID_TRANSCRIPT_LAST"] = 0] = "GRID_TRANSCRIPT_LAST";
|
|
6600
|
+
GridTranscriptDestination[GridTranscriptDestination["GRID_TRANSCRIPT_NEW"] = 1] = "GRID_TRANSCRIPT_NEW";
|
|
6601
|
+
GridTranscriptDestination[GridTranscriptDestination["GRID_TRANSCRIPT_EXISTING"] = 2] = "GRID_TRANSCRIPT_EXISTING";
|
|
6559
6602
|
})(GridTranscriptDestination || (GridTranscriptDestination = {}));
|
|
6560
6603
|
var GridConnectionUnavailableReason;
|
|
6561
|
-
(function(
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6604
|
+
(function(GridConnectionUnavailableReason) {
|
|
6605
|
+
GridConnectionUnavailableReason[GridConnectionUnavailableReason["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6606
|
+
GridConnectionUnavailableReason[GridConnectionUnavailableReason["NOT_ACTIVE"] = 1] = "NOT_ACTIVE";
|
|
6607
|
+
GridConnectionUnavailableReason[GridConnectionUnavailableReason["PROVIDER_UNAVAILABLE"] = 2] = "PROVIDER_UNAVAILABLE";
|
|
6565
6608
|
})(GridConnectionUnavailableReason || (GridConnectionUnavailableReason = {}));
|
|
6566
6609
|
var UsernameAvailability;
|
|
6567
|
-
(function(
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6610
|
+
(function(UsernameAvailability) {
|
|
6611
|
+
UsernameAvailability[UsernameAvailability["USERNAME_AVAILABILITY_UNSPECIFIED"] = 0] = "USERNAME_AVAILABILITY_UNSPECIFIED";
|
|
6612
|
+
UsernameAvailability[UsernameAvailability["USERNAME_AVAILABLE"] = 1] = "USERNAME_AVAILABLE";
|
|
6613
|
+
UsernameAvailability[UsernameAvailability["USERNAME_CURRENT"] = 2] = "USERNAME_CURRENT";
|
|
6614
|
+
UsernameAvailability[UsernameAvailability["USERNAME_TAKEN"] = 3] = "USERNAME_TAKEN";
|
|
6615
|
+
UsernameAvailability[UsernameAvailability["USERNAME_RESERVED"] = 4] = "USERNAME_RESERVED";
|
|
6616
|
+
UsernameAvailability[UsernameAvailability["USERNAME_INVALID"] = 5] = "USERNAME_INVALID";
|
|
6574
6617
|
})(UsernameAvailability || (UsernameAvailability = {}));
|
|
6575
6618
|
var ExternalProfileProvider;
|
|
6576
|
-
(function(
|
|
6577
|
-
|
|
6578
|
-
|
|
6619
|
+
(function(ExternalProfileProvider) {
|
|
6620
|
+
ExternalProfileProvider[ExternalProfileProvider["EXTERNAL_PROFILE_PROVIDER_UNSPECIFIED"] = 0] = "EXTERNAL_PROFILE_PROVIDER_UNSPECIFIED";
|
|
6621
|
+
ExternalProfileProvider[ExternalProfileProvider["EXTERNAL_PROFILE_PROVIDER_X"] = 1] = "EXTERNAL_PROFILE_PROVIDER_X";
|
|
6579
6622
|
})(ExternalProfileProvider || (ExternalProfileProvider = {}));
|
|
6580
6623
|
var ExternalProfilePhotoStatus;
|
|
6581
|
-
(function(
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6624
|
+
(function(ExternalProfilePhotoStatus) {
|
|
6625
|
+
ExternalProfilePhotoStatus[ExternalProfilePhotoStatus["EXTERNAL_PROFILE_PHOTO_STATUS_UNSPECIFIED"] = 0] = "EXTERNAL_PROFILE_PHOTO_STATUS_UNSPECIFIED";
|
|
6626
|
+
ExternalProfilePhotoStatus[ExternalProfilePhotoStatus["EXTERNAL_PROFILE_PHOTO_FOUND"] = 1] = "EXTERNAL_PROFILE_PHOTO_FOUND";
|
|
6627
|
+
ExternalProfilePhotoStatus[ExternalProfilePhotoStatus["EXTERNAL_PROFILE_PHOTO_NOT_FOUND"] = 2] = "EXTERNAL_PROFILE_PHOTO_NOT_FOUND";
|
|
6628
|
+
ExternalProfilePhotoStatus[ExternalProfilePhotoStatus["EXTERNAL_PROFILE_PHOTO_UNAVAILABLE"] = 3] = "EXTERNAL_PROFILE_PHOTO_UNAVAILABLE";
|
|
6586
6629
|
})(ExternalProfilePhotoStatus || (ExternalProfilePhotoStatus = {}));
|
|
6587
6630
|
var PushNotificationProvider;
|
|
6588
|
-
(function(
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
|
|
6631
|
+
(function(PushNotificationProvider) {
|
|
6632
|
+
PushNotificationProvider[PushNotificationProvider["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6633
|
+
PushNotificationProvider[PushNotificationProvider["APNS"] = 1] = "APNS";
|
|
6634
|
+
PushNotificationProvider[PushNotificationProvider["EXPO_ANDROID"] = 2] = "EXPO_ANDROID";
|
|
6592
6635
|
})(PushNotificationProvider || (PushNotificationProvider = {}));
|
|
6593
6636
|
var DeleteDialogFolderDisposition;
|
|
6594
|
-
(function(
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6637
|
+
(function(DeleteDialogFolderDisposition) {
|
|
6638
|
+
DeleteDialogFolderDisposition[DeleteDialogFolderDisposition["DELETE_DIALOG_FOLDER_DISPOSITION_UNSPECIFIED"] = 0] = "DELETE_DIALOG_FOLDER_DISPOSITION_UNSPECIFIED";
|
|
6639
|
+
DeleteDialogFolderDisposition[DeleteDialogFolderDisposition["CLOSE_DIALOGS"] = 1] = "CLOSE_DIALOGS";
|
|
6640
|
+
DeleteDialogFolderDisposition[DeleteDialogFolderDisposition["KEEP_DIALOGS"] = 2] = "KEEP_DIALOGS";
|
|
6598
6641
|
})(DeleteDialogFolderDisposition || (DeleteDialogFolderDisposition = {}));
|
|
6599
6642
|
var GetChatHistoryMode;
|
|
6600
|
-
(function(
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
|
|
6643
|
+
(function(GetChatHistoryMode) {
|
|
6644
|
+
GetChatHistoryMode[GetChatHistoryMode["HISTORY_MODE_UNSPECIFIED"] = 0] = "HISTORY_MODE_UNSPECIFIED";
|
|
6645
|
+
GetChatHistoryMode[GetChatHistoryMode["HISTORY_MODE_LATEST"] = 1] = "HISTORY_MODE_LATEST";
|
|
6646
|
+
GetChatHistoryMode[GetChatHistoryMode["HISTORY_MODE_OLDER"] = 2] = "HISTORY_MODE_OLDER";
|
|
6647
|
+
GetChatHistoryMode[GetChatHistoryMode["HISTORY_MODE_NEWER"] = 3] = "HISTORY_MODE_NEWER";
|
|
6648
|
+
GetChatHistoryMode[GetChatHistoryMode["HISTORY_MODE_AROUND"] = 4] = "HISTORY_MODE_AROUND";
|
|
6606
6649
|
})(GetChatHistoryMode || (GetChatHistoryMode = {}));
|
|
6607
6650
|
var ThreadReferenceKind;
|
|
6608
|
-
(function(
|
|
6609
|
-
|
|
6610
|
-
|
|
6611
|
-
|
|
6651
|
+
(function(ThreadReferenceKind) {
|
|
6652
|
+
ThreadReferenceKind[ThreadReferenceKind["THREAD_REFERENCE_KIND_UNSPECIFIED"] = 0] = "THREAD_REFERENCE_KIND_UNSPECIFIED";
|
|
6653
|
+
ThreadReferenceKind[ThreadReferenceKind["THREAD_LINK"] = 1] = "THREAD_LINK";
|
|
6654
|
+
ThreadReferenceKind[ThreadReferenceKind["REPLY_THREAD"] = 2] = "REPLY_THREAD";
|
|
6612
6655
|
})(ThreadReferenceKind || (ThreadReferenceKind = {}));
|
|
6613
6656
|
var SearchMessagesFilter;
|
|
6614
|
-
(function(
|
|
6615
|
-
|
|
6616
|
-
|
|
6617
|
-
|
|
6618
|
-
|
|
6619
|
-
|
|
6620
|
-
|
|
6621
|
-
|
|
6657
|
+
(function(SearchMessagesFilter) {
|
|
6658
|
+
SearchMessagesFilter[SearchMessagesFilter["FILTER_UNSPECIFIED"] = 0] = "FILTER_UNSPECIFIED";
|
|
6659
|
+
SearchMessagesFilter[SearchMessagesFilter["FILTER_PHOTOS"] = 1] = "FILTER_PHOTOS";
|
|
6660
|
+
SearchMessagesFilter[SearchMessagesFilter["FILTER_VIDEOS"] = 2] = "FILTER_VIDEOS";
|
|
6661
|
+
SearchMessagesFilter[SearchMessagesFilter["FILTER_PHOTO_VIDEO"] = 3] = "FILTER_PHOTO_VIDEO";
|
|
6662
|
+
SearchMessagesFilter[SearchMessagesFilter["FILTER_DOCUMENTS"] = 4] = "FILTER_DOCUMENTS";
|
|
6663
|
+
SearchMessagesFilter[SearchMessagesFilter["FILTER_LINKS"] = 5] = "FILTER_LINKS";
|
|
6664
|
+
SearchMessagesFilter[SearchMessagesFilter["FILTER_VOICE_MEMOS"] = 6] = "FILTER_VOICE_MEMOS";
|
|
6622
6665
|
})(SearchMessagesFilter || (SearchMessagesFilter = {}));
|
|
6623
6666
|
var ExternalResourceProvider;
|
|
6624
|
-
(function(
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6667
|
+
(function(ExternalResourceProvider) {
|
|
6668
|
+
ExternalResourceProvider[ExternalResourceProvider["EXTERNAL_RESOURCE_PROVIDER_UNSPECIFIED"] = 0] = "EXTERNAL_RESOURCE_PROVIDER_UNSPECIFIED";
|
|
6669
|
+
ExternalResourceProvider[ExternalResourceProvider["NOTION"] = 1] = "NOTION";
|
|
6670
|
+
ExternalResourceProvider[ExternalResourceProvider["LINEAR"] = 2] = "LINEAR";
|
|
6671
|
+
ExternalResourceProvider[ExternalResourceProvider["GITHUB"] = 3] = "GITHUB";
|
|
6629
6672
|
})(ExternalResourceProvider || (ExternalResourceProvider = {}));
|
|
6630
6673
|
var ExternalResourceKind;
|
|
6631
|
-
(function(
|
|
6632
|
-
|
|
6633
|
-
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
|
|
6637
|
-
|
|
6638
|
-
|
|
6674
|
+
(function(ExternalResourceKind) {
|
|
6675
|
+
ExternalResourceKind[ExternalResourceKind["EXTERNAL_RESOURCE_KIND_UNSPECIFIED"] = 0] = "EXTERNAL_RESOURCE_KIND_UNSPECIFIED";
|
|
6676
|
+
ExternalResourceKind[ExternalResourceKind["PAGE"] = 1] = "PAGE";
|
|
6677
|
+
ExternalResourceKind[ExternalResourceKind["DATABASE"] = 2] = "DATABASE";
|
|
6678
|
+
ExternalResourceKind[ExternalResourceKind["ISSUE"] = 3] = "ISSUE";
|
|
6679
|
+
ExternalResourceKind[ExternalResourceKind["PULL_REQUEST"] = 4] = "PULL_REQUEST";
|
|
6680
|
+
ExternalResourceKind[ExternalResourceKind["REPOSITORY"] = 5] = "REPOSITORY";
|
|
6681
|
+
ExternalResourceKind[ExternalResourceKind["OTHER"] = 6] = "OTHER";
|
|
6639
6682
|
})(ExternalResourceKind || (ExternalResourceKind = {}));
|
|
6640
6683
|
var ConnectorProvider;
|
|
6641
|
-
(function(
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
|
|
6645
|
-
|
|
6684
|
+
(function(ConnectorProvider) {
|
|
6685
|
+
ConnectorProvider[ConnectorProvider["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6686
|
+
ConnectorProvider[ConnectorProvider["NOTION"] = 1] = "NOTION";
|
|
6687
|
+
ConnectorProvider[ConnectorProvider["LINEAR"] = 2] = "LINEAR";
|
|
6688
|
+
ConnectorProvider[ConnectorProvider["GITHUB"] = 3] = "GITHUB";
|
|
6646
6689
|
})(ConnectorProvider || (ConnectorProvider = {}));
|
|
6647
6690
|
var HttpUploadKind;
|
|
6648
|
-
(function(
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
|
|
6691
|
+
(function(HttpUploadKind) {
|
|
6692
|
+
HttpUploadKind[HttpUploadKind["HTTP_UPLOAD_KIND_UNSPECIFIED"] = 0] = "HTTP_UPLOAD_KIND_UNSPECIFIED";
|
|
6693
|
+
HttpUploadKind[HttpUploadKind["PHOTO"] = 1] = "PHOTO";
|
|
6694
|
+
HttpUploadKind[HttpUploadKind["VIDEO"] = 2] = "VIDEO";
|
|
6695
|
+
HttpUploadKind[HttpUploadKind["DOCUMENT"] = 3] = "DOCUMENT";
|
|
6696
|
+
HttpUploadKind[HttpUploadKind["VOICE"] = 4] = "VOICE";
|
|
6654
6697
|
})(HttpUploadKind || (HttpUploadKind = {}));
|
|
6655
6698
|
var UploadKind;
|
|
6656
|
-
(function(
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
|
|
6660
|
-
|
|
6661
|
-
|
|
6699
|
+
(function(UploadKind) {
|
|
6700
|
+
UploadKind[UploadKind["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6701
|
+
UploadKind[UploadKind["PHOTO"] = 1] = "PHOTO";
|
|
6702
|
+
UploadKind[UploadKind["VIDEO"] = 2] = "VIDEO";
|
|
6703
|
+
UploadKind[UploadKind["DOCUMENT"] = 3] = "DOCUMENT";
|
|
6704
|
+
UploadKind[UploadKind["VOICE"] = 4] = "VOICE";
|
|
6662
6705
|
})(UploadKind || (UploadKind = {}));
|
|
6663
6706
|
var UploadStatus;
|
|
6664
|
-
(function(
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
|
|
6707
|
+
(function(UploadStatus) {
|
|
6708
|
+
UploadStatus[UploadStatus["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6709
|
+
UploadStatus[UploadStatus["UPLOADING"] = 1] = "UPLOADING";
|
|
6710
|
+
UploadStatus[UploadStatus["PROCESSING"] = 2] = "PROCESSING";
|
|
6711
|
+
UploadStatus[UploadStatus["COMPLETE"] = 3] = "COMPLETE";
|
|
6712
|
+
UploadStatus[UploadStatus["FAILED"] = 4] = "FAILED";
|
|
6713
|
+
UploadStatus[UploadStatus["CANCELED"] = 5] = "CANCELED";
|
|
6714
|
+
UploadStatus[UploadStatus["EXPIRED"] = 6] = "EXPIRED";
|
|
6672
6715
|
})(UploadStatus || (UploadStatus = {}));
|
|
6673
6716
|
|
|
6674
6717
|
class ClientMessage$Type extends import_runtime4.MessageType {
|
|
@@ -43143,25 +43186,25 @@ var sbox = /* @__PURE__ */ (() => {
|
|
|
43143
43186
|
var invSbox = /* @__PURE__ */ sbox.map((_, j) => sbox.indexOf(j));
|
|
43144
43187
|
var rotr32_8 = (n) => n << 24 | n >>> 8;
|
|
43145
43188
|
var rotl32_8 = (n) => n << 8 | n >>> 24;
|
|
43146
|
-
function genTtable(
|
|
43147
|
-
if (
|
|
43189
|
+
function genTtable(sbox, fn) {
|
|
43190
|
+
if (sbox.length !== 256)
|
|
43148
43191
|
throw new Error("Wrong sbox length");
|
|
43149
|
-
const T0 = new Uint32Array(256).map((_, j) => fn(
|
|
43192
|
+
const T0 = new Uint32Array(256).map((_, j) => fn(sbox[j]));
|
|
43150
43193
|
const T1 = T0.map(rotl32_8);
|
|
43151
43194
|
const T2 = T1.map(rotl32_8);
|
|
43152
43195
|
const T3 = T2.map(rotl32_8);
|
|
43153
43196
|
const T01 = new Uint32Array(256 * 256);
|
|
43154
43197
|
const T23 = new Uint32Array(256 * 256);
|
|
43155
|
-
const
|
|
43198
|
+
const sbox2 = new Uint16Array(256 * 256);
|
|
43156
43199
|
for (let i = 0;i < 256; i++) {
|
|
43157
43200
|
for (let j = 0;j < 256; j++) {
|
|
43158
43201
|
const idx = i * 256 + j;
|
|
43159
43202
|
T01[idx] = T0[i] ^ T1[j];
|
|
43160
43203
|
T23[idx] = T2[i] ^ T3[j];
|
|
43161
|
-
|
|
43204
|
+
sbox2[idx] = sbox[i] << 8 | sbox[j];
|
|
43162
43205
|
}
|
|
43163
43206
|
}
|
|
43164
|
-
return { sbox
|
|
43207
|
+
return { sbox, sbox2, T0, T1, T2, T3, T01, T23 };
|
|
43165
43208
|
}
|
|
43166
43209
|
var tableEncoding = /* @__PURE__ */ genTtable(sbox, (s) => mul(s, 3) << 24 | s << 16 | s << 8 | mul(s, 2));
|
|
43167
43210
|
var tableDecoding = /* @__PURE__ */ genTtable(invSbox, (s) => mul(s, 11) << 24 | mul(s, 13) << 16 | mul(s, 9) << 8 | mul(s, 14));
|
|
@@ -43226,11 +43269,11 @@ function encrypt(xk, s0, s1, s2, s3) {
|
|
|
43226
43269
|
s0 ^= xk[k++], s1 ^= xk[k++], s2 ^= xk[k++], s3 ^= xk[k++];
|
|
43227
43270
|
const rounds = xk.length / 4 - 2;
|
|
43228
43271
|
for (let i = 0;i < rounds; i++) {
|
|
43229
|
-
const
|
|
43230
|
-
const
|
|
43231
|
-
const
|
|
43232
|
-
const
|
|
43233
|
-
s0 =
|
|
43272
|
+
const t0 = xk[k++] ^ apply0123(T01, T23, s0, s1, s2, s3);
|
|
43273
|
+
const t1 = xk[k++] ^ apply0123(T01, T23, s1, s2, s3, s0);
|
|
43274
|
+
const t2 = xk[k++] ^ apply0123(T01, T23, s2, s3, s0, s1);
|
|
43275
|
+
const t3 = xk[k++] ^ apply0123(T01, T23, s3, s0, s1, s2);
|
|
43276
|
+
s0 = t0, s1 = t1, s2 = t2, s3 = t3;
|
|
43234
43277
|
}
|
|
43235
43278
|
const t0 = xk[k++] ^ applySbox(sbox2, s0, s1, s2, s3);
|
|
43236
43279
|
const t1 = xk[k++] ^ applySbox(sbox2, s1, s2, s3, s0);
|
|
@@ -43244,11 +43287,11 @@ function decrypt(xk, s0, s1, s2, s3) {
|
|
|
43244
43287
|
s0 ^= xk[k++], s1 ^= xk[k++], s2 ^= xk[k++], s3 ^= xk[k++];
|
|
43245
43288
|
const rounds = xk.length / 4 - 2;
|
|
43246
43289
|
for (let i = 0;i < rounds; i++) {
|
|
43247
|
-
const
|
|
43248
|
-
const
|
|
43249
|
-
const
|
|
43250
|
-
const
|
|
43251
|
-
s0 =
|
|
43290
|
+
const t0 = xk[k++] ^ apply0123(T01, T23, s0, s3, s2, s1);
|
|
43291
|
+
const t1 = xk[k++] ^ apply0123(T01, T23, s1, s0, s3, s2);
|
|
43292
|
+
const t2 = xk[k++] ^ apply0123(T01, T23, s2, s1, s0, s3);
|
|
43293
|
+
const t3 = xk[k++] ^ apply0123(T01, T23, s3, s2, s1, s0);
|
|
43294
|
+
s0 = t0, s1 = t1, s2 = t2, s3 = t3;
|
|
43252
43295
|
}
|
|
43253
43296
|
const t0 = xk[k++] ^ applySbox(sbox2, s0, s3, s2, s1);
|
|
43254
43297
|
const t1 = xk[k++] ^ applySbox(sbox2, s1, s0, s3, s2);
|
|
@@ -43663,9 +43706,9 @@ var decodeInlineApplicationObject = (bytes) => {
|
|
|
43663
43706
|
const reader = new TlReader(bytes.slice(4));
|
|
43664
43707
|
if (constructor === INLINE_INVOKE_CONSTRUCTOR) {
|
|
43665
43708
|
const layer = reader.readInt();
|
|
43666
|
-
const
|
|
43709
|
+
const payload = reader.readBytes();
|
|
43667
43710
|
reader.expectEnd();
|
|
43668
|
-
return { kind: "invoke", layer, payload
|
|
43711
|
+
return { kind: "invoke", layer, payload };
|
|
43669
43712
|
}
|
|
43670
43713
|
const payload = reader.readBytes();
|
|
43671
43714
|
reader.expectEnd();
|
|
@@ -44622,16 +44665,16 @@ var rawDataBytes = (data) => {
|
|
|
44622
44665
|
throw new InlineProtocolV3Error("protocol", "Unsupported WebSocket frame type");
|
|
44623
44666
|
};
|
|
44624
44667
|
var randomInt64 = (random) => {
|
|
44625
|
-
const
|
|
44626
|
-
if (
|
|
44668
|
+
const bytes = random(8);
|
|
44669
|
+
if (bytes.length !== 8)
|
|
44627
44670
|
throw new InlineProtocolV3Error("protocol", "CSPRNG returned an invalid value");
|
|
44628
|
-
return new DataView(
|
|
44671
|
+
return new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength).getBigInt64(0, true);
|
|
44629
44672
|
};
|
|
44630
44673
|
var randomLowBits = (random) => {
|
|
44631
|
-
const
|
|
44632
|
-
if (
|
|
44674
|
+
const bytes = random(4);
|
|
44675
|
+
if (bytes.length !== 4)
|
|
44633
44676
|
throw new InlineProtocolV3Error("protocol", "CSPRNG returned an invalid value");
|
|
44634
|
-
return new DataView(
|
|
44677
|
+
return new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength).getUint32(0, true) & 1073741823;
|
|
44635
44678
|
};
|
|
44636
44679
|
var recordPadding = (bodyLength, random) => {
|
|
44637
44680
|
const length = 12 + (16 - (32 + bodyLength + 12) % 16) % 16;
|
|
@@ -44752,9 +44795,9 @@ class InlineProtocolV3Connection {
|
|
|
44752
44795
|
async#invoke(request, onDispatched, signal) {
|
|
44753
44796
|
const payload = RealtimeV3Request.toBinary(request);
|
|
44754
44797
|
const result = await this.#sendContent(encodeInlineInvoke(payload), onDispatched, signal);
|
|
44755
|
-
let
|
|
44798
|
+
let application;
|
|
44756
44799
|
try {
|
|
44757
|
-
|
|
44800
|
+
application = decodeInlineApplicationObject(result);
|
|
44758
44801
|
} catch (error) {
|
|
44759
44802
|
if (serviceConstructor(result) === ServiceConstructor.rpcError) {
|
|
44760
44803
|
const rpcError = decodeRpcError(result);
|
|
@@ -44767,10 +44810,10 @@ class InlineProtocolV3Connection {
|
|
|
44767
44810
|
}
|
|
44768
44811
|
throw error;
|
|
44769
44812
|
}
|
|
44770
|
-
if (
|
|
44813
|
+
if (application.kind !== "result") {
|
|
44771
44814
|
throw new InlineProtocolV3Error("protocol", "Expected an Inline application result");
|
|
44772
44815
|
}
|
|
44773
|
-
return RealtimeV3Response.fromBinary(
|
|
44816
|
+
return RealtimeV3Response.fromBinary(application.payload);
|
|
44774
44817
|
}
|
|
44775
44818
|
async authBegin(request) {
|
|
44776
44819
|
const response = await this.invoke({ body: { oneofKind: "authBegin", authBegin: request } });
|
|
@@ -44858,15 +44901,15 @@ class InlineProtocolV3Connection {
|
|
|
44858
44901
|
if (!authorization?.temporary || authorization.expiresAt === undefined || this.#closing)
|
|
44859
44902
|
return;
|
|
44860
44903
|
const boundary = authorization.expiresAt * 1000 - TEMPORARY_KEY_ROTATION_MILLISECONDS;
|
|
44861
|
-
const
|
|
44862
|
-
if (!Number.isFinite(
|
|
44904
|
+
const delay = boundary - this.#clock.nowMilliseconds();
|
|
44905
|
+
if (!Number.isFinite(delay) || delay <= 0) {
|
|
44863
44906
|
this.#markRotationDue();
|
|
44864
44907
|
return;
|
|
44865
44908
|
}
|
|
44866
44909
|
const timer = setTimeout(() => {
|
|
44867
44910
|
this.#rotationTimer = undefined;
|
|
44868
44911
|
this.#scheduleRotationTimer();
|
|
44869
|
-
}, Math.min(
|
|
44912
|
+
}, Math.min(delay, 2147000000));
|
|
44870
44913
|
if (typeof timer !== "number" && typeof timer.unref === "function")
|
|
44871
44914
|
timer.unref();
|
|
44872
44915
|
this.#rotationTimer = timer;
|
|
@@ -44968,17 +45011,17 @@ class InlineProtocolV3Connection {
|
|
|
44968
45011
|
this.#sendRaw(this.#carrier.wireHeader);
|
|
44969
45012
|
}
|
|
44970
45013
|
async#handshake(temporary) {
|
|
44971
|
-
const
|
|
45014
|
+
const handshake = new InlineHandshakeClient({
|
|
44972
45015
|
rsaKeys: this.#rsaKeys,
|
|
44973
45016
|
randomBytes: this.#random,
|
|
44974
45017
|
dc: 1
|
|
44975
45018
|
});
|
|
44976
|
-
let request =
|
|
45019
|
+
let request = handshake.begin(temporary);
|
|
44977
45020
|
for (;; ) {
|
|
44978
45021
|
const messageId = this.#messageIds.next(Date.now(), randomLowBits(this.#random), 0);
|
|
44979
45022
|
this.#sendPacket(encodeUnencryptedRecord(messageId, request));
|
|
44980
45023
|
const response = decodeUnencryptedRecord(await this.#receivePacket(this.#options.requestTimeoutMs ?? REQUEST_TIMEOUT_MS));
|
|
44981
|
-
const result =
|
|
45024
|
+
const result = handshake.receive(response.body);
|
|
44982
45025
|
if ("request" in result) {
|
|
44983
45026
|
request = result.request;
|
|
44984
45027
|
continue;
|
|
@@ -45062,20 +45105,20 @@ class InlineProtocolV3Connection {
|
|
|
45062
45105
|
const fields = await this.#receiveEncrypted();
|
|
45063
45106
|
if (fields.sequenceNumber % 2 === 1)
|
|
45064
45107
|
await this.#sendAcknowledgements([fields.messageId]);
|
|
45065
|
-
const
|
|
45066
|
-
if (
|
|
45108
|
+
const constructor = serviceConstructor(fields.body);
|
|
45109
|
+
if (constructor === ServiceConstructor.newSessionCreated) {
|
|
45067
45110
|
this.#setServerSalt(readInt64LE(fields.body, 20));
|
|
45068
45111
|
continue;
|
|
45069
45112
|
}
|
|
45070
|
-
if (
|
|
45113
|
+
if (constructor === ServiceConstructor.msgsAck) {
|
|
45071
45114
|
decodeMsgsAck(fields.body);
|
|
45072
45115
|
continue;
|
|
45073
45116
|
}
|
|
45074
|
-
if (
|
|
45117
|
+
if (constructor === ServiceConstructor.badMsgNotification || constructor === ServiceConstructor.badServerSalt) {
|
|
45075
45118
|
this.#handleBadMessage(fields.body, fields.messageId);
|
|
45076
45119
|
continue;
|
|
45077
45120
|
}
|
|
45078
|
-
if (
|
|
45121
|
+
if (constructor === ServiceConstructor.rpcResult) {
|
|
45079
45122
|
const result = decodeRpcResult(fields.body);
|
|
45080
45123
|
const pending = this.#pendingContent.get(result.requestMessageId);
|
|
45081
45124
|
if (!pending)
|
|
@@ -45087,7 +45130,7 @@ class InlineProtocolV3Connection {
|
|
|
45087
45130
|
pending.resolve({ messageId: result.requestMessageId, result: result.result });
|
|
45088
45131
|
continue;
|
|
45089
45132
|
}
|
|
45090
|
-
if (
|
|
45133
|
+
if (constructor === ServiceConstructor.pong) {
|
|
45091
45134
|
if (fields.body.length !== 20)
|
|
45092
45135
|
throw new InlineProtocolV3Error("protocol", "Invalid pong");
|
|
45093
45136
|
const requestMessageId = readInt64LE(fields.body, 4);
|
|
@@ -45106,9 +45149,9 @@ class InlineProtocolV3Connection {
|
|
|
45106
45149
|
continue;
|
|
45107
45150
|
}
|
|
45108
45151
|
try {
|
|
45109
|
-
const
|
|
45110
|
-
if (
|
|
45111
|
-
this.#options.onUpdate?.(RealtimeV3Update.fromBinary(
|
|
45152
|
+
const application = decodeInlineApplicationObject(fields.body);
|
|
45153
|
+
if (application.kind === "update") {
|
|
45154
|
+
this.#options.onUpdate?.(RealtimeV3Update.fromBinary(application.payload));
|
|
45112
45155
|
}
|
|
45113
45156
|
} catch {}
|
|
45114
45157
|
}
|
|
@@ -45202,14 +45245,14 @@ class InlineProtocolV3Connection {
|
|
|
45202
45245
|
const authorization = this.#authorization;
|
|
45203
45246
|
if (!authorization)
|
|
45204
45247
|
throw new InlineProtocolV3Error("unauthorized", "Authorization-key handshake is incomplete");
|
|
45205
|
-
const
|
|
45248
|
+
const record = encryptRecord(authorization.key, "client-to-server", {
|
|
45206
45249
|
serverSalt: authorization.serverSalt,
|
|
45207
45250
|
sessionId: this.#sessionId,
|
|
45208
45251
|
messageId,
|
|
45209
45252
|
sequenceNumber,
|
|
45210
45253
|
body
|
|
45211
45254
|
}, recordPadding(body.length, this.#random));
|
|
45212
|
-
this.#sendPacket(
|
|
45255
|
+
this.#sendPacket(record, quickAck);
|
|
45213
45256
|
}
|
|
45214
45257
|
#nextClientMessageId() {
|
|
45215
45258
|
return this.#messageIds.next(this.#clock.nowMilliseconds(), randomLowBits(this.#random), 0);
|
|
@@ -45220,32 +45263,32 @@ class InlineProtocolV3Connection {
|
|
|
45220
45263
|
this.#authorization.serverSalt = serverSalt;
|
|
45221
45264
|
}
|
|
45222
45265
|
#sendPacket(packet, quickAck = false) {
|
|
45223
|
-
const
|
|
45224
|
-
if (!
|
|
45266
|
+
const carrier = this.#carrier;
|
|
45267
|
+
if (!carrier)
|
|
45225
45268
|
throw new InlineProtocolV3Error("closed", "Inline Protocol carrier is unavailable");
|
|
45226
|
-
this.#sendRaw(
|
|
45269
|
+
this.#sendRaw(carrier.outbound.process(encodeAbridgedPacket(packet, quickAck)));
|
|
45227
45270
|
}
|
|
45228
45271
|
async#receivePacket(timeoutMs) {
|
|
45229
|
-
const
|
|
45230
|
-
if (!
|
|
45272
|
+
const carrier = this.#carrier;
|
|
45273
|
+
if (!carrier)
|
|
45231
45274
|
throw new InlineProtocolV3Error("closed", "Inline Protocol carrier is unavailable");
|
|
45232
45275
|
for (;; ) {
|
|
45233
45276
|
const wire = await this.#inbox.next(timeoutMs);
|
|
45234
|
-
const frame = decodeAbridgedFrame(
|
|
45277
|
+
const frame = decodeAbridgedFrame(carrier.inbound.process(wire));
|
|
45235
45278
|
if (frame.kind === "quickAck")
|
|
45236
45279
|
continue;
|
|
45237
45280
|
return frame.payload;
|
|
45238
45281
|
}
|
|
45239
45282
|
}
|
|
45240
|
-
#sendRaw(
|
|
45283
|
+
#sendRaw(bytes) {
|
|
45241
45284
|
const socket = this.#socket;
|
|
45242
45285
|
if (!socket || socket.readyState !== import_websocket.default.OPEN)
|
|
45243
45286
|
throw new InlineProtocolV3Error("closed", "Inline Protocol connection is not open");
|
|
45244
45287
|
const bufferedAmount = Number.isFinite(socket.bufferedAmount) ? socket.bufferedAmount : 0;
|
|
45245
|
-
if (bufferedAmount +
|
|
45288
|
+
if (bufferedAmount + bytes.byteLength > MAXIMUM_OUTBOUND_BUFFER_BYTES) {
|
|
45246
45289
|
throw new InlineProtocolV3Error("closed", `Inline Protocol outbound buffer exceeded ${MAXIMUM_OUTBOUND_BUFFER_BYTES} bytes`);
|
|
45247
45290
|
}
|
|
45248
|
-
socket.send(
|
|
45291
|
+
socket.send(bytes);
|
|
45249
45292
|
}
|
|
45250
45293
|
}
|
|
45251
45294
|
|
|
@@ -45977,9 +46020,9 @@ var reconnectPolicyForRpc = (method, input) => {
|
|
|
45977
46020
|
return replaySafeRpcMethods.has(method) ? "replay-safe" : "never-replay";
|
|
45978
46021
|
};
|
|
45979
46022
|
var randomMessageId = () => {
|
|
45980
|
-
const
|
|
45981
|
-
globalThis.crypto.getRandomValues(
|
|
45982
|
-
const value = new DataView(
|
|
46023
|
+
const bytes = new Uint8Array(8);
|
|
46024
|
+
globalThis.crypto.getRandomValues(bytes);
|
|
46025
|
+
const value = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength).getBigInt64(0, true);
|
|
45983
46026
|
return value === 0n ? 1n : value;
|
|
45984
46027
|
};
|
|
45985
46028
|
var normalizeMessageRandomId = (value) => {
|
|
@@ -46492,8 +46535,8 @@ class InlineSdkClient {
|
|
|
46492
46535
|
}
|
|
46493
46536
|
async registerDesiredBotCapabilities() {
|
|
46494
46537
|
if (this.botCapabilitiesRegistrationInFlight) {
|
|
46495
|
-
const
|
|
46496
|
-
return this.registeredBotCapabilitiesRevision < this.desiredBotCapabilitiesRevision ? await this.registerDesiredBotCapabilities() :
|
|
46538
|
+
const result = await this.botCapabilitiesRegistrationInFlight;
|
|
46539
|
+
return this.registeredBotCapabilitiesRevision < this.desiredBotCapabilitiesRevision ? await this.registerDesiredBotCapabilities() : result;
|
|
46497
46540
|
}
|
|
46498
46541
|
const capabilities = this.desiredBotCapabilities;
|
|
46499
46542
|
if (capabilities == null)
|
|
@@ -46502,9 +46545,9 @@ class InlineSdkClient {
|
|
|
46502
46545
|
const registration = this.invoke(Method.SET_MY_BOT_CAPABILITIES, {
|
|
46503
46546
|
oneofKind: "setMyBotCapabilities",
|
|
46504
46547
|
setMyBotCapabilities: { capabilities }
|
|
46505
|
-
}).then((
|
|
46548
|
+
}).then((result) => {
|
|
46506
46549
|
this.registeredBotCapabilitiesRevision = Math.max(this.registeredBotCapabilitiesRevision, revision);
|
|
46507
|
-
return { capabilities:
|
|
46550
|
+
return { capabilities: result.setMyBotCapabilities.capabilities };
|
|
46508
46551
|
});
|
|
46509
46552
|
this.botCapabilitiesRegistrationInFlight = registration;
|
|
46510
46553
|
let result;
|
|
@@ -47135,14 +47178,14 @@ class InlineSdkClient {
|
|
|
47135
47178
|
try {
|
|
47136
47179
|
acknowledged = this.eventStream.send(event);
|
|
47137
47180
|
} catch (error) {
|
|
47138
|
-
const
|
|
47139
|
-
if (
|
|
47140
|
-
this.fenceLiveCursor(
|
|
47141
|
-
this.markUpdateBucketDegraded(
|
|
47142
|
-
this.requestCatchUpAfterEventOverflow(
|
|
47181
|
+
const bucket = this.bucketForEvent(event);
|
|
47182
|
+
if (bucket) {
|
|
47183
|
+
this.fenceLiveCursor(bucket);
|
|
47184
|
+
this.markUpdateBucketDegraded(bucket);
|
|
47185
|
+
this.requestCatchUpAfterEventOverflow(bucket, event);
|
|
47143
47186
|
}
|
|
47144
47187
|
this.log.warn?.("Inbound event buffer overflow; durable cursor remains unchanged and transport will recover", {
|
|
47145
|
-
bucket:
|
|
47188
|
+
bucket: bucket ? this.updateBucketKey(bucket) : "none",
|
|
47146
47189
|
error: extractErrorMessage(error)
|
|
47147
47190
|
});
|
|
47148
47191
|
this.requestRecoveryReconnect("inbound-event-buffer-overflow");
|
|
@@ -47347,8 +47390,8 @@ class InlineSdkClient {
|
|
|
47347
47390
|
requestCatchUpForDegradedBucket(bucket) {
|
|
47348
47391
|
switch (bucket.kind) {
|
|
47349
47392
|
case "chat": {
|
|
47350
|
-
const
|
|
47351
|
-
const updateSeq =
|
|
47393
|
+
const request = this.catchUpRequestedByChatId.get(bucket.chatId) ?? this.peerResolutionRequestedByChatId.get(bucket.chatId);
|
|
47394
|
+
const updateSeq = request && !request.toLatest ? request.endSeq : undefined;
|
|
47352
47395
|
const peer = bucket.peer ?? this.persistedChatPeer(bucket.chatId);
|
|
47353
47396
|
if (peer && this.isReliableChatPeer(peer)) {
|
|
47354
47397
|
this.requestCatchUpChat({ chatId: bucket.chatId, peer, updateSeq });
|
|
@@ -47358,10 +47401,10 @@ class InlineSdkClient {
|
|
|
47358
47401
|
return;
|
|
47359
47402
|
}
|
|
47360
47403
|
case "space": {
|
|
47361
|
-
const
|
|
47404
|
+
const request = this.catchUpRequestedBySpaceId.get(bucket.spaceId);
|
|
47362
47405
|
this.requestCatchUpSpace({
|
|
47363
47406
|
spaceId: bucket.spaceId,
|
|
47364
|
-
updateSeq:
|
|
47407
|
+
updateSeq: request && !request.toLatest ? request.endSeq : undefined
|
|
47365
47408
|
});
|
|
47366
47409
|
return;
|
|
47367
47410
|
}
|
|
@@ -47840,20 +47883,20 @@ class InlineSdkClient {
|
|
|
47840
47883
|
});
|
|
47841
47884
|
const payload = result.getUpdates;
|
|
47842
47885
|
if (payload.resultType === GetUpdatesResult_ResultType.TOO_LONG) {
|
|
47843
|
-
const
|
|
47844
|
-
if (endSeq != null && requestEndSeq != null &&
|
|
47886
|
+
const deliveredSeq = Number(payload.seq ?? 0n);
|
|
47887
|
+
if (endSeq != null && requestEndSeq != null && deliveredSeq !== requestEndSeq) {
|
|
47845
47888
|
this.markUpdateBucketDegraded({ kind: "chat", chatId, peer });
|
|
47846
47889
|
this.log.warn?.("GET_UPDATES TOO_LONG pointer did not cover the requested chat target", {
|
|
47847
47890
|
chatId: chatId.toString(),
|
|
47848
47891
|
requestedEndSeq: requestEndSeq,
|
|
47849
|
-
deliveredSeq
|
|
47892
|
+
deliveredSeq
|
|
47850
47893
|
});
|
|
47851
47894
|
return true;
|
|
47852
47895
|
}
|
|
47853
|
-
const shouldContinue = this.shouldContinueBoundedCatchUp(cursor,
|
|
47854
|
-
const repaired = await this.repairUpdateBucketAuthoritatively({ kind: "chat", chatId, peer },
|
|
47896
|
+
const shouldContinue = this.shouldContinueBoundedCatchUp(cursor, deliveredSeq, requestEndSeq, endSeq);
|
|
47897
|
+
const repaired = await this.repairUpdateBucketAuthoritatively({ kind: "chat", chatId, peer }, deliveredSeq, payload.date, !shouldContinue);
|
|
47855
47898
|
if (repaired && shouldContinue) {
|
|
47856
|
-
cursor =
|
|
47899
|
+
cursor = deliveredSeq;
|
|
47857
47900
|
continue;
|
|
47858
47901
|
}
|
|
47859
47902
|
return true;
|
|
@@ -47987,20 +48030,20 @@ class InlineSdkClient {
|
|
|
47987
48030
|
});
|
|
47988
48031
|
const payload = result.getUpdates;
|
|
47989
48032
|
if (payload.resultType === GetUpdatesResult_ResultType.TOO_LONG) {
|
|
47990
|
-
const
|
|
47991
|
-
if (endSeq != null && requestEndSeq != null &&
|
|
48033
|
+
const deliveredSeq = Number(payload.seq ?? 0n);
|
|
48034
|
+
if (endSeq != null && requestEndSeq != null && deliveredSeq !== requestEndSeq) {
|
|
47992
48035
|
this.markUpdateBucketDegraded({ kind: "space", spaceId });
|
|
47993
48036
|
this.log.warn?.("GET_UPDATES TOO_LONG pointer did not cover the requested space target", {
|
|
47994
48037
|
spaceId: spaceId.toString(),
|
|
47995
48038
|
requestedEndSeq: requestEndSeq,
|
|
47996
|
-
deliveredSeq
|
|
48039
|
+
deliveredSeq
|
|
47997
48040
|
});
|
|
47998
48041
|
return true;
|
|
47999
48042
|
}
|
|
48000
|
-
const shouldContinue = this.shouldContinueBoundedCatchUp(cursor,
|
|
48001
|
-
const repaired = await this.repairUpdateBucketAuthoritatively({ kind: "space", spaceId },
|
|
48043
|
+
const shouldContinue = this.shouldContinueBoundedCatchUp(cursor, deliveredSeq, requestEndSeq, endSeq);
|
|
48044
|
+
const repaired = await this.repairUpdateBucketAuthoritatively({ kind: "space", spaceId }, deliveredSeq, payload.date, !shouldContinue);
|
|
48002
48045
|
if (repaired && shouldContinue) {
|
|
48003
|
-
cursor =
|
|
48046
|
+
cursor = deliveredSeq;
|
|
48004
48047
|
continue;
|
|
48005
48048
|
}
|
|
48006
48049
|
return true;
|
|
@@ -48845,16 +48888,16 @@ class InlineUserDirectory {
|
|
|
48845
48888
|
this.onError = options.onError;
|
|
48846
48889
|
}
|
|
48847
48890
|
async resolve(params) {
|
|
48848
|
-
const
|
|
48849
|
-
if (hasDisplayIdentity(
|
|
48850
|
-
return
|
|
48891
|
+
const cached = this.getFresh(params.userId.toString());
|
|
48892
|
+
if (hasDisplayIdentity(cached))
|
|
48893
|
+
return cached;
|
|
48851
48894
|
return (await this.resolveWithProvenance(params)).profile;
|
|
48852
48895
|
}
|
|
48853
48896
|
async resolveWithProvenance(params) {
|
|
48854
48897
|
const userId = params.userId.toString();
|
|
48855
|
-
const
|
|
48856
|
-
if (
|
|
48857
|
-
return { profile:
|
|
48898
|
+
const cached = this.getFresh(userId);
|
|
48899
|
+
if (cached?.bot != null) {
|
|
48900
|
+
return { profile: cached, provenanceVerified: true };
|
|
48858
48901
|
}
|
|
48859
48902
|
if (params.direct) {
|
|
48860
48903
|
const directoryHydrated = await this.hydrateDirectory();
|
|
@@ -48911,16 +48954,16 @@ class InlineUserDirectory {
|
|
|
48911
48954
|
}
|
|
48912
48955
|
}
|
|
48913
48956
|
getFresh(userId) {
|
|
48914
|
-
const
|
|
48915
|
-
if (!
|
|
48957
|
+
const cached = this.profiles.get(userId);
|
|
48958
|
+
if (!cached)
|
|
48916
48959
|
return;
|
|
48917
|
-
if (
|
|
48960
|
+
if (cached.expiresAt <= this.now()) {
|
|
48918
48961
|
this.profiles.delete(userId);
|
|
48919
48962
|
return;
|
|
48920
48963
|
}
|
|
48921
48964
|
this.profiles.delete(userId);
|
|
48922
|
-
this.profiles.set(userId,
|
|
48923
|
-
return
|
|
48965
|
+
this.profiles.set(userId, cached);
|
|
48966
|
+
return cached.profile;
|
|
48924
48967
|
}
|
|
48925
48968
|
async hydrateChat(chatId) {
|
|
48926
48969
|
const key = chatId.toString();
|
|
@@ -49005,8 +49048,8 @@ function readBooleanProfileField(value, previous, key) {
|
|
|
49005
49048
|
function readUsers(result, kind) {
|
|
49006
49049
|
if (!result || typeof result !== "object")
|
|
49007
49050
|
return [];
|
|
49008
|
-
const
|
|
49009
|
-
const payload =
|
|
49051
|
+
const record = result;
|
|
49052
|
+
const payload = record[kind];
|
|
49010
49053
|
if (!payload || typeof payload !== "object")
|
|
49011
49054
|
return [];
|
|
49012
49055
|
const users = payload.users;
|
|
@@ -49347,8 +49390,8 @@ async function handleRequest(req, res) {
|
|
|
49347
49390
|
return;
|
|
49348
49391
|
}
|
|
49349
49392
|
if (url.pathname === "/inbound/ack") {
|
|
49350
|
-
const
|
|
49351
|
-
const deliveryId = readRequiredString(
|
|
49393
|
+
const body = asRecord(await readJsonBody(req));
|
|
49394
|
+
const deliveryId = readRequiredString(body, "deliveryId");
|
|
49352
49395
|
inboundStream.acknowledge(deliveryId);
|
|
49353
49396
|
writeJson(res, 200, { ok: true, result: {} });
|
|
49354
49397
|
return;
|
|
@@ -49453,14 +49496,14 @@ async function handleRequest(req, res) {
|
|
|
49453
49496
|
}
|
|
49454
49497
|
}
|
|
49455
49498
|
async function endpointSend(res, body) {
|
|
49456
|
-
const
|
|
49457
|
-
const target = parseTarget(
|
|
49458
|
-
const text = readOptionalString(
|
|
49459
|
-
const replyToMsgId = readOptionalInlineId(
|
|
49460
|
-
const parseMarkdown = readOptionalBoolean(
|
|
49461
|
-
const actions = parseActions(
|
|
49462
|
-
const sendMode = readOptionalString(
|
|
49463
|
-
const media = parseSendMedia(
|
|
49499
|
+
const record = asRecord(body);
|
|
49500
|
+
const target = parseTarget(record);
|
|
49501
|
+
const text = readOptionalString(record, "text");
|
|
49502
|
+
const replyToMsgId = readOptionalInlineId(record, "replyToMsgId");
|
|
49503
|
+
const parseMarkdown = readOptionalBoolean(record, "parseMarkdown") ?? true;
|
|
49504
|
+
const actions = parseActions(record.actions);
|
|
49505
|
+
const sendMode = readOptionalString(record, "sendMode");
|
|
49506
|
+
const media = parseSendMedia(record.media);
|
|
49464
49507
|
if (!text && !media) {
|
|
49465
49508
|
throw new SidecarError("send requires text or media", "bad_format");
|
|
49466
49509
|
}
|
|
@@ -49475,12 +49518,12 @@ async function endpointSend(res, body) {
|
|
|
49475
49518
|
writeJson(res, 200, { ok: true, result: { messageId: result.messageId?.toString() ?? null } });
|
|
49476
49519
|
}
|
|
49477
49520
|
async function endpointEdit(res, body) {
|
|
49478
|
-
const
|
|
49479
|
-
const target = parseTarget(
|
|
49480
|
-
const messageId = readRequiredInlineId(
|
|
49481
|
-
const text = readRequiredString(
|
|
49482
|
-
const actions = parseActions(
|
|
49483
|
-
const parseMarkdown = readOptionalBoolean(
|
|
49521
|
+
const record = asRecord(body);
|
|
49522
|
+
const target = parseTarget(record);
|
|
49523
|
+
const messageId = readRequiredInlineId(record, "messageId");
|
|
49524
|
+
const text = readRequiredString(record, "text");
|
|
49525
|
+
const actions = parseActions(record.actions);
|
|
49526
|
+
const parseMarkdown = readOptionalBoolean(record, "parseMarkdown") ?? true;
|
|
49484
49527
|
await client.invoke(Method.EDIT_MESSAGE, {
|
|
49485
49528
|
oneofKind: "editMessage",
|
|
49486
49529
|
editMessage: {
|
|
@@ -49494,9 +49537,9 @@ async function endpointEdit(res, body) {
|
|
|
49494
49537
|
writeJson(res, 200, { ok: true, result: { messageId: messageId.toString() } });
|
|
49495
49538
|
}
|
|
49496
49539
|
async function endpointDelete(res, body) {
|
|
49497
|
-
const
|
|
49498
|
-
const target = parseTarget(
|
|
49499
|
-
const messageId = readRequiredInlineId(
|
|
49540
|
+
const record = asRecord(body);
|
|
49541
|
+
const target = parseTarget(record);
|
|
49542
|
+
const messageId = readRequiredInlineId(record, "messageId");
|
|
49500
49543
|
await client.invoke(Method.DELETE_MESSAGES, {
|
|
49501
49544
|
oneofKind: "deleteMessages",
|
|
49502
49545
|
deleteMessages: {
|
|
@@ -49507,9 +49550,9 @@ async function endpointDelete(res, body) {
|
|
|
49507
49550
|
writeJson(res, 200, { ok: true, result: { messageId: messageId.toString() } });
|
|
49508
49551
|
}
|
|
49509
49552
|
async function endpointTyping(res, body) {
|
|
49510
|
-
const
|
|
49511
|
-
const target = parseTarget(
|
|
49512
|
-
const state = readOptionalString(
|
|
49553
|
+
const record = asRecord(body);
|
|
49554
|
+
const target = parseTarget(record);
|
|
49555
|
+
const state = readOptionalString(record, "state") ?? "start";
|
|
49513
49556
|
if ("userId" in target) {
|
|
49514
49557
|
writeJson(res, 200, { ok: true, result: { skipped: "typing is chat-only" } });
|
|
49515
49558
|
return;
|
|
@@ -49525,10 +49568,10 @@ async function endpointTyping(res, body) {
|
|
|
49525
49568
|
writeJson(res, 200, { ok: true, result: {} });
|
|
49526
49569
|
}
|
|
49527
49570
|
async function endpointPresence(res, body) {
|
|
49528
|
-
const
|
|
49529
|
-
const target = parseTarget(
|
|
49530
|
-
const kind = readRequiredString(
|
|
49531
|
-
const comment = readOptionalString(
|
|
49571
|
+
const record = asRecord(body);
|
|
49572
|
+
const target = parseTarget(record);
|
|
49573
|
+
const kind = readRequiredString(record, "kind");
|
|
49574
|
+
const comment = readOptionalString(record, "comment");
|
|
49532
49575
|
if ("chatId" in target) {
|
|
49533
49576
|
await client.setBotPresenceState({ chatId: target.chatId, kind, ...comment ? { comment } : {} });
|
|
49534
49577
|
} else {
|
|
@@ -49537,15 +49580,15 @@ async function endpointPresence(res, body) {
|
|
|
49537
49580
|
writeJson(res, 200, { ok: true, result: {} });
|
|
49538
49581
|
}
|
|
49539
49582
|
async function endpointSendAttachment(res, body) {
|
|
49540
|
-
const
|
|
49541
|
-
const target = parseTarget(
|
|
49542
|
-
const filePath = readRequiredString(
|
|
49543
|
-
const kind = normalizeUploadKind(readOptionalString(
|
|
49544
|
-
const caption = readOptionalString(
|
|
49545
|
-
const parseMarkdown = readOptionalBoolean(
|
|
49546
|
-
const replyToMsgId = readOptionalInlineId(
|
|
49547
|
-
const fileName = readOptionalString(
|
|
49548
|
-
const contentType = readOptionalString(
|
|
49583
|
+
const record = asRecord(body);
|
|
49584
|
+
const target = parseTarget(record);
|
|
49585
|
+
const filePath = readRequiredString(record, "path");
|
|
49586
|
+
const kind = normalizeUploadKind(readOptionalString(record, "kind"), filePath);
|
|
49587
|
+
const caption = readOptionalString(record, "caption");
|
|
49588
|
+
const parseMarkdown = readOptionalBoolean(record, "parseMarkdown") ?? true;
|
|
49589
|
+
const replyToMsgId = readOptionalInlineId(record, "replyToMsgId");
|
|
49590
|
+
const fileName = readOptionalString(record, "fileName") || path.basename(filePath);
|
|
49591
|
+
const contentType = readOptionalString(record, "mimeType");
|
|
49549
49592
|
const info = await statAttachment(filePath);
|
|
49550
49593
|
if (info.size > uploadMaxBytes) {
|
|
49551
49594
|
throw new SidecarError(`attachment exceeds Inline upload cap (${info.size} > ${uploadMaxBytes} bytes)`, "too_long");
|
|
@@ -49598,8 +49641,8 @@ function hasNodeErrorCode(error, ...codes) {
|
|
|
49598
49641
|
return Boolean(error && typeof error === "object" && "code" in error && typeof error.code === "string" && codes.includes(error.code));
|
|
49599
49642
|
}
|
|
49600
49643
|
async function endpointChat(res, body) {
|
|
49601
|
-
const
|
|
49602
|
-
const target = parseTarget(
|
|
49644
|
+
const record = asRecord(body);
|
|
49645
|
+
const target = parseTarget(record);
|
|
49603
49646
|
if ("userId" in target) {
|
|
49604
49647
|
const sender = await userDirectory.resolve({ userId: target.userId, chatId: target.userId, direct: true });
|
|
49605
49648
|
writeJson(res, 200, {
|
|
@@ -49642,9 +49685,9 @@ async function endpointChat(res, body) {
|
|
|
49642
49685
|
});
|
|
49643
49686
|
}
|
|
49644
49687
|
async function endpointFollowMode(res, body) {
|
|
49645
|
-
const
|
|
49646
|
-
const target = parseTarget(
|
|
49647
|
-
const mode = readRequiredString(
|
|
49688
|
+
const record = asRecord(body);
|
|
49689
|
+
const target = parseTarget(record);
|
|
49690
|
+
const mode = readRequiredString(record, "mode");
|
|
49648
49691
|
const followMode = mode === "following" ? DialogFollowMode.FOLLOWING : mode === "unfollowed" ? DialogFollowMode.UNFOLLOWED : null;
|
|
49649
49692
|
if (followMode == null) {
|
|
49650
49693
|
throw new SidecarError("mode must be following or unfollowed", "bad_format");
|
|
@@ -49659,18 +49702,18 @@ async function endpointFollowMode(res, body) {
|
|
|
49659
49702
|
writeJson(res, 200, { ok: true, result: { mode } });
|
|
49660
49703
|
}
|
|
49661
49704
|
async function endpointMessages(res, body) {
|
|
49662
|
-
const
|
|
49663
|
-
const target = parseTarget(
|
|
49664
|
-
const messageIds = readInlineIdArray(
|
|
49705
|
+
const record = asRecord(body);
|
|
49706
|
+
const target = parseTarget(record);
|
|
49707
|
+
const messageIds = readInlineIdArray(record, "messageIds", 100, true);
|
|
49665
49708
|
const result = "chatId" in target ? await client.getMessages({ chatId: target.chatId, messageIds }) : await client.getMessages({ userId: target.userId, messageIds });
|
|
49666
49709
|
const ordered = orderMessagesByRequestedIds(result.messages, messageIds);
|
|
49667
49710
|
writeJson(res, 200, { ok: true, result: { messages: safeJson(await enrichMessages(ordered, target)) } });
|
|
49668
49711
|
}
|
|
49669
49712
|
async function endpointHistory(res, body) {
|
|
49670
|
-
const
|
|
49671
|
-
const target = parseTarget(
|
|
49672
|
-
const limit = readOptionalNumber(
|
|
49673
|
-
const anchorId = readOptionalInlineId(
|
|
49713
|
+
const record = asRecord(body);
|
|
49714
|
+
const target = parseTarget(record);
|
|
49715
|
+
const limit = readOptionalNumber(record, "limit") ?? 20;
|
|
49716
|
+
const anchorId = readOptionalInlineId(record, "anchorId");
|
|
49674
49717
|
const result = await client.invoke(Method.GET_CHAT_HISTORY, {
|
|
49675
49718
|
oneofKind: "getChatHistory",
|
|
49676
49719
|
getChatHistory: {
|
|
@@ -49684,13 +49727,13 @@ async function endpointHistory(res, body) {
|
|
|
49684
49727
|
writeJson(res, 200, { ok: true, result: { messages: safeJson(await enrichMessages(messages, target)) } });
|
|
49685
49728
|
}
|
|
49686
49729
|
async function endpointSearch(res, body) {
|
|
49687
|
-
const
|
|
49688
|
-
const target = parseTarget(
|
|
49689
|
-
const query = readRequiredString(
|
|
49730
|
+
const record = asRecord(body);
|
|
49731
|
+
const target = parseTarget(record);
|
|
49732
|
+
const query = readRequiredString(record, "query").trim();
|
|
49690
49733
|
if (!query)
|
|
49691
49734
|
throw new SidecarError("search requires query", "bad_format");
|
|
49692
|
-
const limit = clampResultLimit(readOptionalNumber(
|
|
49693
|
-
const offsetId = readOptionalInlineId(
|
|
49735
|
+
const limit = clampResultLimit(readOptionalNumber(record, "limit") ?? 20, 100);
|
|
49736
|
+
const offsetId = readOptionalInlineId(record, "offsetId");
|
|
49694
49737
|
const result = await client.invokeUncheckedRaw(Method.SEARCH_MESSAGES, {
|
|
49695
49738
|
oneofKind: "searchMessages",
|
|
49696
49739
|
searchMessages: {
|
|
@@ -49705,13 +49748,13 @@ async function endpointSearch(res, body) {
|
|
|
49705
49748
|
writeJson(res, 200, { ok: true, result: { messages: safeJson(await enrichMessages(messages, target)) } });
|
|
49706
49749
|
}
|
|
49707
49750
|
async function endpointReaction(res, body) {
|
|
49708
|
-
const
|
|
49709
|
-
const target = parseTarget(
|
|
49710
|
-
const messageId = readRequiredInlineId(
|
|
49711
|
-
const emoji = readRequiredString(
|
|
49751
|
+
const record = asRecord(body);
|
|
49752
|
+
const target = parseTarget(record);
|
|
49753
|
+
const messageId = readRequiredInlineId(record, "messageId");
|
|
49754
|
+
const emoji = readRequiredString(record, "emoji").trim();
|
|
49712
49755
|
if (!emoji)
|
|
49713
49756
|
throw new SidecarError("reaction requires emoji", "bad_format");
|
|
49714
|
-
const remove = readOptionalBoolean(
|
|
49757
|
+
const remove = readOptionalBoolean(record, "remove") ?? false;
|
|
49715
49758
|
if (remove) {
|
|
49716
49759
|
await client.invokeUncheckedRaw(Method.DELETE_REACTION, {
|
|
49717
49760
|
oneofKind: "deleteReaction",
|
|
@@ -49734,9 +49777,9 @@ async function endpointReaction(res, body) {
|
|
|
49734
49777
|
writeJson(res, 200, { ok: true, result: { messageId: messageId.toString(), emoji, removed: remove } });
|
|
49735
49778
|
}
|
|
49736
49779
|
async function endpointReactions(res, body) {
|
|
49737
|
-
const
|
|
49738
|
-
const target = parseTarget(
|
|
49739
|
-
const messageId = readRequiredInlineId(
|
|
49780
|
+
const record = asRecord(body);
|
|
49781
|
+
const target = parseTarget(record);
|
|
49782
|
+
const messageId = readRequiredInlineId(record, "messageId");
|
|
49740
49783
|
const result = "chatId" in target ? await client.getMessages({ chatId: target.chatId, messageIds: [messageId] }) : await client.getMessages({ userId: target.userId, messageIds: [messageId] });
|
|
49741
49784
|
const message = result.messages[0] ?? null;
|
|
49742
49785
|
const enriched = message == null ? null : (await enrichMessages([message], target))[0] ?? message;
|
|
@@ -49749,10 +49792,10 @@ async function endpointReactions(res, body) {
|
|
|
49749
49792
|
});
|
|
49750
49793
|
}
|
|
49751
49794
|
async function endpointPin(res, body) {
|
|
49752
|
-
const
|
|
49753
|
-
const target = parseTarget(
|
|
49754
|
-
const messageId = readRequiredInlineId(
|
|
49755
|
-
const unpin = readOptionalBoolean(
|
|
49795
|
+
const record = asRecord(body);
|
|
49796
|
+
const target = parseTarget(record);
|
|
49797
|
+
const messageId = readRequiredInlineId(record, "messageId");
|
|
49798
|
+
const unpin = readOptionalBoolean(record, "unpin") ?? false;
|
|
49756
49799
|
await client.invokeUncheckedRaw(Method.PIN_MESSAGE, {
|
|
49757
49800
|
oneofKind: "pinMessage",
|
|
49758
49801
|
pinMessage: {
|
|
@@ -49764,8 +49807,8 @@ async function endpointPin(res, body) {
|
|
|
49764
49807
|
writeJson(res, 200, { ok: true, result: { messageId: messageId.toString(), unpinned: unpin } });
|
|
49765
49808
|
}
|
|
49766
49809
|
async function endpointPins(res, body) {
|
|
49767
|
-
const
|
|
49768
|
-
const target = parseTarget(
|
|
49810
|
+
const record = asRecord(body);
|
|
49811
|
+
const target = parseTarget(record);
|
|
49769
49812
|
if ("userId" in target) {
|
|
49770
49813
|
throw new SidecarError("pins requires a chat target", "bad_format");
|
|
49771
49814
|
}
|
|
@@ -49782,12 +49825,12 @@ async function endpointPins(res, body) {
|
|
|
49782
49825
|
});
|
|
49783
49826
|
}
|
|
49784
49827
|
async function endpointCreateSubthread(res, body) {
|
|
49785
|
-
const
|
|
49786
|
-
const parentChatId = readRequiredInlineId(
|
|
49787
|
-
const parentMessageId = readOptionalInlineId(
|
|
49788
|
-
const title = readOptionalString(
|
|
49789
|
-
const description = readOptionalString(
|
|
49790
|
-
const emoji = readOptionalString(
|
|
49828
|
+
const record = asRecord(body);
|
|
49829
|
+
const parentChatId = readRequiredInlineId(record, "parentChatId");
|
|
49830
|
+
const parentMessageId = readOptionalInlineId(record, "parentMessageId");
|
|
49831
|
+
const title = readOptionalString(record, "title");
|
|
49832
|
+
const description = readOptionalString(record, "description");
|
|
49833
|
+
const emoji = readOptionalString(record, "emoji");
|
|
49791
49834
|
const result = await client.invokeUncheckedRaw(Method.CREATE_SUBTHREAD, {
|
|
49792
49835
|
oneofKind: "createSubthread",
|
|
49793
49836
|
createSubthread: {
|
|
@@ -49810,9 +49853,9 @@ async function endpointCreateSubthread(res, body) {
|
|
|
49810
49853
|
});
|
|
49811
49854
|
}
|
|
49812
49855
|
async function endpointAddParticipants(res, body) {
|
|
49813
|
-
const
|
|
49814
|
-
const chatId = readRequiredInlineId(
|
|
49815
|
-
const userIds = readInlineIdArray(
|
|
49856
|
+
const record = asRecord(body);
|
|
49857
|
+
const chatId = readRequiredInlineId(record, "chatId");
|
|
49858
|
+
const userIds = readInlineIdArray(record, "userIds", 50, true);
|
|
49816
49859
|
const added = [];
|
|
49817
49860
|
for (const userId of userIds) {
|
|
49818
49861
|
await client.invokeUncheckedRaw(Method.ADD_CHAT_PARTICIPANT, {
|
|
@@ -49824,10 +49867,10 @@ async function endpointAddParticipants(res, body) {
|
|
|
49824
49867
|
writeJson(res, 200, { ok: true, result: { chatId: chatId.toString(), addedUserIds: added } });
|
|
49825
49868
|
}
|
|
49826
49869
|
async function endpointUpdateChat(res, body) {
|
|
49827
|
-
const
|
|
49828
|
-
const chatId = readRequiredInlineId(
|
|
49829
|
-
const title = readOptionalString(
|
|
49830
|
-
const emoji = readOptionalString(
|
|
49870
|
+
const record = asRecord(body);
|
|
49871
|
+
const chatId = readRequiredInlineId(record, "chatId");
|
|
49872
|
+
const title = readOptionalString(record, "title");
|
|
49873
|
+
const emoji = readOptionalString(record, "emoji");
|
|
49831
49874
|
if (title === undefined && emoji === undefined) {
|
|
49832
49875
|
throw new SidecarError("update-chat requires title or emoji", "bad_format");
|
|
49833
49876
|
}
|
|
@@ -49840,8 +49883,8 @@ async function endpointUpdateChat(res, body) {
|
|
|
49840
49883
|
writeJson(res, 200, { ok: true, result: { chatId: chatId.toString(), chat: safeJson(chat ?? null) } });
|
|
49841
49884
|
}
|
|
49842
49885
|
async function endpointDeleteChat(res, body) {
|
|
49843
|
-
const
|
|
49844
|
-
const chatId = readRequiredInlineId(
|
|
49886
|
+
const record = asRecord(body);
|
|
49887
|
+
const chatId = readRequiredInlineId(record, "chatId");
|
|
49845
49888
|
await client.invokeUncheckedRaw(Method.DELETE_CHAT, {
|
|
49846
49889
|
oneofKind: "deleteChat",
|
|
49847
49890
|
deleteChat: { peerId: inputPeerFromTarget({ chatId }) }
|
|
@@ -49849,13 +49892,13 @@ async function endpointDeleteChat(res, body) {
|
|
|
49849
49892
|
writeJson(res, 200, { ok: true, result: { chatId: chatId.toString(), deleted: true } });
|
|
49850
49893
|
}
|
|
49851
49894
|
async function endpointCreateChat(res, body) {
|
|
49852
|
-
const
|
|
49853
|
-
const title = readRequiredString(
|
|
49854
|
-
const description = readOptionalString(
|
|
49855
|
-
const emoji = readOptionalString(
|
|
49856
|
-
const spaceId = readOptionalInlineId(
|
|
49857
|
-
const isPublic = readOptionalBoolean(
|
|
49858
|
-
const participantUserIds = readInlineIdArray(
|
|
49895
|
+
const record = asRecord(body);
|
|
49896
|
+
const title = readRequiredString(record, "title");
|
|
49897
|
+
const description = readOptionalString(record, "description");
|
|
49898
|
+
const emoji = readOptionalString(record, "emoji");
|
|
49899
|
+
const spaceId = readOptionalInlineId(record, "spaceId");
|
|
49900
|
+
const isPublic = readOptionalBoolean(record, "isPublic") ?? false;
|
|
49901
|
+
const participantUserIds = readInlineIdArray(record, "participantUserIds", 50);
|
|
49859
49902
|
if (title.length > 200)
|
|
49860
49903
|
throw new SidecarError("create-chat title is too long", "bad_format");
|
|
49861
49904
|
if (description && description.length > 1000) {
|
|
@@ -49915,15 +49958,15 @@ async function callBotApi(methodName, method, body, query) {
|
|
|
49915
49958
|
return asOptionalRecord(payload.result) ?? {};
|
|
49916
49959
|
}
|
|
49917
49960
|
async function endpointCreateAgent(res, body) {
|
|
49918
|
-
const
|
|
49919
|
-
const name = readRequiredString(
|
|
49961
|
+
const record = asRecord(body);
|
|
49962
|
+
const name = readRequiredString(record, "name");
|
|
49920
49963
|
const result = await callBotApi("createAgent", "POST", {
|
|
49921
49964
|
name,
|
|
49922
|
-
...readOptionalString(
|
|
49923
|
-
...readOptionalString(
|
|
49924
|
-
...readOptionalString(
|
|
49925
|
-
...readOptionalString(
|
|
49926
|
-
...readOptionalString(
|
|
49965
|
+
...readOptionalString(record, "handle") ? { handle: readOptionalString(record, "handle") } : {},
|
|
49966
|
+
...readOptionalString(record, "emoji") ? { emoji: readOptionalString(record, "emoji") } : {},
|
|
49967
|
+
...readOptionalString(record, "description") ? { description: readOptionalString(record, "description") } : {},
|
|
49968
|
+
...readOptionalString(record, "skill_key") ? { skill_key: readOptionalString(record, "skill_key") } : {},
|
|
49969
|
+
...readOptionalString(record, "instructions") ? { instructions: readOptionalString(record, "instructions") } : {}
|
|
49927
49970
|
});
|
|
49928
49971
|
const agent = asOptionalRecord(result.agent);
|
|
49929
49972
|
if (!agent) {
|
|
@@ -49932,8 +49975,8 @@ async function endpointCreateAgent(res, body) {
|
|
|
49932
49975
|
writeJson(res, 200, { ok: true, result: { agent: safeJson(agent) } });
|
|
49933
49976
|
}
|
|
49934
49977
|
async function endpointGetAgent(res, body) {
|
|
49935
|
-
const
|
|
49936
|
-
const agentId = readRequiredInlineId(
|
|
49978
|
+
const record = asRecord(body);
|
|
49979
|
+
const agentId = readRequiredInlineId(record, "agentId");
|
|
49937
49980
|
const result = await callBotApi("getAgent", "GET", undefined, { agent_id: String(agentId) });
|
|
49938
49981
|
if (!asOptionalRecord(result.agent)) {
|
|
49939
49982
|
throw new SidecarError("Agent not found", "not_found");
|
|
@@ -49944,29 +49987,29 @@ async function endpointListAgents(res) {
|
|
|
49944
49987
|
const result = await callBotApi("getMyAgents", "GET");
|
|
49945
49988
|
writeJson(res, 200, { ok: true, result: safeJson(result) });
|
|
49946
49989
|
}
|
|
49947
|
-
function readAgentPatchString(
|
|
49948
|
-
if (!(key in
|
|
49990
|
+
function readAgentPatchString(record, key) {
|
|
49991
|
+
if (!(key in record))
|
|
49949
49992
|
return;
|
|
49950
|
-
const value =
|
|
49993
|
+
const value = record[key];
|
|
49951
49994
|
if (typeof value !== "string") {
|
|
49952
49995
|
throw new SidecarError(`${key} must be a string`, "bad_format");
|
|
49953
49996
|
}
|
|
49954
49997
|
return value.trim();
|
|
49955
49998
|
}
|
|
49956
49999
|
async function endpointUpdateAgent(res, body) {
|
|
49957
|
-
const
|
|
49958
|
-
const agentId = readRequiredInlineId(
|
|
49959
|
-
const name = readAgentPatchString(
|
|
50000
|
+
const record = asRecord(body);
|
|
50001
|
+
const agentId = readRequiredInlineId(record, "agentId");
|
|
50002
|
+
const name = readAgentPatchString(record, "name");
|
|
49960
50003
|
if (name !== undefined && !name) {
|
|
49961
50004
|
throw new SidecarError("name cannot be empty", "bad_format");
|
|
49962
50005
|
}
|
|
49963
50006
|
const patch = {
|
|
49964
50007
|
...name !== undefined ? { name } : {},
|
|
49965
|
-
...agentPatchField(
|
|
49966
|
-
...agentPatchField(
|
|
49967
|
-
...agentPatchField(
|
|
49968
|
-
...agentPatchField(
|
|
49969
|
-
...agentPatchField(
|
|
50008
|
+
...agentPatchField(record, "handle"),
|
|
50009
|
+
...agentPatchField(record, "emoji"),
|
|
50010
|
+
...agentPatchField(record, "description"),
|
|
50011
|
+
...agentPatchField(record, "skill_key"),
|
|
50012
|
+
...agentPatchField(record, "instructions")
|
|
49970
50013
|
};
|
|
49971
50014
|
if (Object.keys(patch).length === 0) {
|
|
49972
50015
|
throw new SidecarError("update-agent requires at least one field", "bad_format");
|
|
@@ -49980,13 +50023,13 @@ async function endpointUpdateAgent(res, body) {
|
|
|
49980
50023
|
throw new SidecarError("update-agent returned no Agent", "unknown");
|
|
49981
50024
|
writeJson(res, 200, { ok: true, result: { agent: safeJson(agent) } });
|
|
49982
50025
|
}
|
|
49983
|
-
function agentPatchField(
|
|
49984
|
-
const value = readAgentPatchString(
|
|
50026
|
+
function agentPatchField(record, key) {
|
|
50027
|
+
const value = readAgentPatchString(record, key);
|
|
49985
50028
|
return value === undefined ? {} : { [key]: value };
|
|
49986
50029
|
}
|
|
49987
50030
|
async function endpointDeleteAgent(res, body) {
|
|
49988
|
-
const
|
|
49989
|
-
const agentId = readRequiredInlineId(
|
|
50031
|
+
const record = asRecord(body);
|
|
50032
|
+
const agentId = readRequiredInlineId(record, "agentId");
|
|
49990
50033
|
const result = await callBotApi("deleteAgent", "POST", { agent_id: String(agentId) });
|
|
49991
50034
|
writeJson(res, 200, { ok: true, result: safeJson(result) });
|
|
49992
50035
|
}
|
|
@@ -50025,26 +50068,26 @@ function senderDisplayName(sender) {
|
|
|
50025
50068
|
}
|
|
50026
50069
|
async function enrichMessages(messages, target) {
|
|
50027
50070
|
return Promise.all(messages.map(async (message) => {
|
|
50028
|
-
const
|
|
50029
|
-
if (!
|
|
50071
|
+
const record = asOptionalRecord(message);
|
|
50072
|
+
if (!record)
|
|
50030
50073
|
return message;
|
|
50031
|
-
const userId = asPositiveBigInt(
|
|
50032
|
-
const chatId = "chatId" in target ? target.chatId : asPositiveBigInt(
|
|
50074
|
+
const userId = asPositiveBigInt(record.fromId);
|
|
50075
|
+
const chatId = "chatId" in target ? target.chatId : asPositiveBigInt(record.chatId);
|
|
50033
50076
|
if (!userId || !chatId)
|
|
50034
50077
|
return message;
|
|
50035
50078
|
const sender = await userDirectory.resolve({
|
|
50036
50079
|
userId,
|
|
50037
50080
|
chatId,
|
|
50038
|
-
direct: "userId" in target || messagePeerIsDirect(
|
|
50081
|
+
direct: "userId" in target || messagePeerIsDirect(record)
|
|
50039
50082
|
});
|
|
50040
|
-
return sender ? { ...
|
|
50083
|
+
return sender ? { ...record, sender } : message;
|
|
50041
50084
|
}));
|
|
50042
50085
|
}
|
|
50043
50086
|
function orderMessagesByRequestedIds(messages, requestedIds) {
|
|
50044
50087
|
const byId = new Map;
|
|
50045
50088
|
for (const message of messages) {
|
|
50046
|
-
const
|
|
50047
|
-
const id = asPositiveBigInt(
|
|
50089
|
+
const record = asOptionalRecord(message);
|
|
50090
|
+
const id = asPositiveBigInt(record?.id);
|
|
50048
50091
|
if (id && !byId.has(id.toString()))
|
|
50049
50092
|
byId.set(id.toString(), message);
|
|
50050
50093
|
}
|
|
@@ -50089,9 +50132,9 @@ function clampResultLimit(value, max) {
|
|
|
50089
50132
|
return Math.min(value, max);
|
|
50090
50133
|
}
|
|
50091
50134
|
async function endpointAnswerAction(res, body) {
|
|
50092
|
-
const
|
|
50093
|
-
const interactionId = readRequiredInlineId(
|
|
50094
|
-
const toastText = readOptionalString(
|
|
50135
|
+
const record = asRecord(body);
|
|
50136
|
+
const interactionId = readRequiredInlineId(record, "interactionId");
|
|
50137
|
+
const toastText = readOptionalString(record, "toast");
|
|
50095
50138
|
await client.answerMessageAction({
|
|
50096
50139
|
interactionId,
|
|
50097
50140
|
...toastText ? { ui: MessageActionResponseUi.create({
|
|
@@ -50101,12 +50144,12 @@ async function endpointAnswerAction(res, body) {
|
|
|
50101
50144
|
writeJson(res, 200, { ok: true, result: {} });
|
|
50102
50145
|
}
|
|
50103
50146
|
async function endpointAnswerBotSettings(res, body) {
|
|
50104
|
-
const
|
|
50105
|
-
if (
|
|
50147
|
+
const record = asRecord(body);
|
|
50148
|
+
if (record.requestId == null || record.requestId === "") {
|
|
50106
50149
|
throw new SidecarError("missing requestId", "bad_format");
|
|
50107
50150
|
}
|
|
50108
|
-
const requestId = parseUnsigned64Id(
|
|
50109
|
-
const response = asRecord(
|
|
50151
|
+
const requestId = parseUnsigned64Id(record.requestId, "requestId");
|
|
50152
|
+
const response = asRecord(record.response);
|
|
50110
50153
|
await client.answerBotChatSettings({ requestId, response });
|
|
50111
50154
|
writeJson(res, 200, { ok: true, result: {} });
|
|
50112
50155
|
}
|
|
@@ -50488,7 +50531,9 @@ var server = http.createServer((req, res) => {
|
|
|
50488
50531
|
writeJson(res, err.status, {
|
|
50489
50532
|
ok: false,
|
|
50490
50533
|
error: err.message,
|
|
50491
|
-
errorKind: err.errorKind
|
|
50534
|
+
errorKind: err.errorKind,
|
|
50535
|
+
...err.outcomeUnknown ? { outcomeUnknown: true } : {},
|
|
50536
|
+
...err.retryAfterSeconds ? { retryAfterSeconds: err.retryAfterSeconds } : {}
|
|
50492
50537
|
});
|
|
50493
50538
|
});
|
|
50494
50539
|
});
|