@gbozee/ultimate 0.0.2-102 → 0.0.2-103
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/frontend/frontend-index.js +1318 -0
- package/dist/frontend-index.d.ts +6 -0
- package/dist/frontend-index.js +25 -8
- package/dist/index.cjs +286 -94
- package/dist/index.d.ts +94 -0
- package/dist/index.js +294 -98
- package/dist/mcp-client.cjs +50 -25
- package/dist/mcp-client.js +50 -25
- package/dist/mcp-server.cjs +285 -97
- package/dist/mcp-server.js +293 -101
- package/dist/mcp.d.ts +5 -0
- package/package.json +1 -1
package/dist/mcp-server.js
CHANGED
|
@@ -229,7 +229,8 @@ var init_errors = __esm(() => {
|
|
|
229
229
|
|
|
230
230
|
// node_modules/jose/dist/node/esm/runtime/random.js
|
|
231
231
|
import { randomFillSync } from "node:crypto";
|
|
232
|
-
var init_random = () => {
|
|
232
|
+
var init_random = () => {
|
|
233
|
+
};
|
|
233
234
|
|
|
234
235
|
// node_modules/jose/dist/node/esm/lib/iv.js
|
|
235
236
|
function bitLength(alg) {
|
|
@@ -270,7 +271,8 @@ var init_check_iv_length = __esm(() => {
|
|
|
270
271
|
// node_modules/jose/dist/node/esm/runtime/is_key_object.js
|
|
271
272
|
import * as util3 from "node:util";
|
|
272
273
|
var is_key_object_default = (obj) => util3.types.isKeyObject(obj);
|
|
273
|
-
var init_is_key_object = () => {
|
|
274
|
+
var init_is_key_object = () => {
|
|
275
|
+
};
|
|
274
276
|
|
|
275
277
|
// node_modules/jose/dist/node/esm/runtime/check_cek_length.js
|
|
276
278
|
var checkCekLength = (enc, cek) => {
|
|
@@ -532,7 +534,8 @@ var ciphers, ciphers_default = (algorithm) => {
|
|
|
532
534
|
ciphers ||= new Set(getCiphers());
|
|
533
535
|
return ciphers.has(algorithm);
|
|
534
536
|
};
|
|
535
|
-
var init_ciphers = () => {
|
|
537
|
+
var init_ciphers = () => {
|
|
538
|
+
};
|
|
536
539
|
|
|
537
540
|
// node_modules/jose/dist/node/esm/runtime/is_key_like.js
|
|
538
541
|
var is_key_like_default = (key) => is_key_object_default(key) || isCryptoKey(key), types3;
|
|
@@ -563,7 +566,8 @@ function cbcDecrypt(enc, cek, ciphertext, iv, tag, aad) {
|
|
|
563
566
|
let macCheckPassed;
|
|
564
567
|
try {
|
|
565
568
|
macCheckPassed = timing_safe_equal_default(tag, expectedTag);
|
|
566
|
-
} catch {
|
|
569
|
+
} catch {
|
|
570
|
+
}
|
|
567
571
|
if (!macCheckPassed) {
|
|
568
572
|
throw new JWEDecryptionFailed;
|
|
569
573
|
}
|
|
@@ -571,7 +575,8 @@ function cbcDecrypt(enc, cek, ciphertext, iv, tag, aad) {
|
|
|
571
575
|
try {
|
|
572
576
|
const decipher = createDecipheriv(algorithm, encKey, iv);
|
|
573
577
|
plaintext = concat(decipher.update(ciphertext), decipher.final());
|
|
574
|
-
} catch {
|
|
578
|
+
} catch {
|
|
579
|
+
}
|
|
575
580
|
if (!plaintext) {
|
|
576
581
|
throw new JWEDecryptionFailed;
|
|
577
582
|
}
|
|
@@ -749,7 +754,8 @@ function isPublicJWK(key) {
|
|
|
749
754
|
function isSecretJWK(key) {
|
|
750
755
|
return isJWK(key) && key.kty === "oct" && typeof key.k === "string";
|
|
751
756
|
}
|
|
752
|
-
var init_is_jwk = () => {
|
|
757
|
+
var init_is_jwk = () => {
|
|
758
|
+
};
|
|
753
759
|
|
|
754
760
|
// node_modules/jose/dist/node/esm/runtime/get_named_curve.js
|
|
755
761
|
import { KeyObject as KeyObject3 } from "node:crypto";
|
|
@@ -932,12 +938,14 @@ var check_key_length_default = (key, alg) => {
|
|
|
932
938
|
} else {
|
|
933
939
|
modulusLength = Buffer.from(key.n, "base64url").byteLength << 3;
|
|
934
940
|
}
|
|
935
|
-
} catch {
|
|
941
|
+
} catch {
|
|
942
|
+
}
|
|
936
943
|
if (typeof modulusLength !== "number" || modulusLength < 2048) {
|
|
937
944
|
throw new TypeError(`${alg} requires key modulusLength to be 2048 bits or larger`);
|
|
938
945
|
}
|
|
939
946
|
};
|
|
940
|
-
var init_check_key_length = () => {
|
|
947
|
+
var init_check_key_length = () => {
|
|
948
|
+
};
|
|
941
949
|
|
|
942
950
|
// node_modules/jose/dist/node/esm/runtime/rsaes.js
|
|
943
951
|
import { KeyObject as KeyObject7, publicEncrypt, constants, privateDecrypt } from "node:crypto";
|
|
@@ -1691,7 +1699,8 @@ async function generalDecrypt(jwe, key, options) {
|
|
|
1691
1699
|
tag: jwe.tag,
|
|
1692
1700
|
unprotected: jwe.unprotected
|
|
1693
1701
|
}, key, options);
|
|
1694
|
-
} catch {
|
|
1702
|
+
} catch {
|
|
1703
|
+
}
|
|
1695
1704
|
}
|
|
1696
1705
|
throw new JWEDecryptionFailed;
|
|
1697
1706
|
}
|
|
@@ -2576,7 +2585,8 @@ async function generalVerify(jws, key, options) {
|
|
|
2576
2585
|
protected: signature.protected,
|
|
2577
2586
|
signature: signature.signature
|
|
2578
2587
|
}, key, options);
|
|
2579
|
-
} catch {
|
|
2588
|
+
} catch {
|
|
2589
|
+
}
|
|
2580
2590
|
}
|
|
2581
2591
|
throw new JWSSignatureVerificationFailed;
|
|
2582
2592
|
}
|
|
@@ -2659,7 +2669,8 @@ var normalizeTyp = (value) => value.toLowerCase().replace(/^application\//, ""),
|
|
|
2659
2669
|
let payload;
|
|
2660
2670
|
try {
|
|
2661
2671
|
payload = JSON.parse(decoder.decode(encodedPayload));
|
|
2662
|
-
} catch {
|
|
2672
|
+
} catch {
|
|
2673
|
+
}
|
|
2663
2674
|
if (!isObject(payload)) {
|
|
2664
2675
|
throw new JWTInvalid("JWT Claims Set must be a top-level JSON object");
|
|
2665
2676
|
}
|
|
@@ -3344,7 +3355,8 @@ class LocalJWKSet {
|
|
|
3344
3355
|
for (const jwk2 of candidates) {
|
|
3345
3356
|
try {
|
|
3346
3357
|
yield await importWithAlgCache(_cached, jwk2, alg);
|
|
3347
|
-
} catch {
|
|
3358
|
+
} catch {
|
|
3359
|
+
}
|
|
3348
3360
|
}
|
|
3349
3361
|
};
|
|
3350
3362
|
throw error;
|
|
@@ -3891,7 +3903,8 @@ var require_util = __commonJS((exports) => {
|
|
|
3891
3903
|
var util5;
|
|
3892
3904
|
(function(util6) {
|
|
3893
3905
|
util6.assertEqual = (val) => val;
|
|
3894
|
-
function assertIs(_arg) {
|
|
3906
|
+
function assertIs(_arg) {
|
|
3907
|
+
}
|
|
3895
3908
|
util6.assertIs = assertIs;
|
|
3896
3909
|
function assertNever(_x) {
|
|
3897
3910
|
throw new Error;
|
|
@@ -6307,7 +6320,8 @@ var require_types = __commonJS((exports) => {
|
|
|
6307
6320
|
});
|
|
6308
6321
|
status.dirty();
|
|
6309
6322
|
}
|
|
6310
|
-
} else if (unknownKeys === "strip") {
|
|
6323
|
+
} else if (unknownKeys === "strip") {
|
|
6324
|
+
} else {
|
|
6311
6325
|
throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
|
|
6312
6326
|
}
|
|
6313
6327
|
} else {
|
|
@@ -8459,7 +8473,8 @@ var require_logLevelLogger = __commonJS((exports) => {
|
|
|
8459
8473
|
if (typeof theFunc === "function" && maxLevel >= theLevel) {
|
|
8460
8474
|
return theFunc.bind(logger);
|
|
8461
8475
|
}
|
|
8462
|
-
return function() {
|
|
8476
|
+
return function() {
|
|
8477
|
+
};
|
|
8463
8478
|
}
|
|
8464
8479
|
return {
|
|
8465
8480
|
error: _filterFunc("error", types_1.DiagLogLevel.ERROR),
|
|
@@ -8684,7 +8699,8 @@ var require_NoopMeter = __commonJS((exports) => {
|
|
|
8684
8699
|
exports.createNoopMeter = exports.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = exports.NOOP_OBSERVABLE_GAUGE_METRIC = exports.NOOP_OBSERVABLE_COUNTER_METRIC = exports.NOOP_UP_DOWN_COUNTER_METRIC = exports.NOOP_HISTOGRAM_METRIC = exports.NOOP_GAUGE_METRIC = exports.NOOP_COUNTER_METRIC = exports.NOOP_METER = exports.NoopObservableUpDownCounterMetric = exports.NoopObservableGaugeMetric = exports.NoopObservableCounterMetric = exports.NoopObservableMetric = exports.NoopHistogramMetric = exports.NoopGaugeMetric = exports.NoopUpDownCounterMetric = exports.NoopCounterMetric = exports.NoopMetric = exports.NoopMeter = undefined;
|
|
8685
8700
|
|
|
8686
8701
|
class NoopMeter {
|
|
8687
|
-
constructor() {
|
|
8702
|
+
constructor() {
|
|
8703
|
+
}
|
|
8688
8704
|
createGauge(_name, _options) {
|
|
8689
8705
|
return exports.NOOP_GAUGE_METRIC;
|
|
8690
8706
|
}
|
|
@@ -8706,8 +8722,10 @@ var require_NoopMeter = __commonJS((exports) => {
|
|
|
8706
8722
|
createObservableUpDownCounter(_name, _options) {
|
|
8707
8723
|
return exports.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC;
|
|
8708
8724
|
}
|
|
8709
|
-
addBatchObservableCallback(_callback, _observables) {
|
|
8710
|
-
|
|
8725
|
+
addBatchObservableCallback(_callback, _observables) {
|
|
8726
|
+
}
|
|
8727
|
+
removeBatchObservableCallback(_callback) {
|
|
8728
|
+
}
|
|
8711
8729
|
}
|
|
8712
8730
|
exports.NoopMeter = NoopMeter;
|
|
8713
8731
|
|
|
@@ -8716,28 +8734,34 @@ var require_NoopMeter = __commonJS((exports) => {
|
|
|
8716
8734
|
exports.NoopMetric = NoopMetric;
|
|
8717
8735
|
|
|
8718
8736
|
class NoopCounterMetric extends NoopMetric {
|
|
8719
|
-
add(_value, _attributes) {
|
|
8737
|
+
add(_value, _attributes) {
|
|
8738
|
+
}
|
|
8720
8739
|
}
|
|
8721
8740
|
exports.NoopCounterMetric = NoopCounterMetric;
|
|
8722
8741
|
|
|
8723
8742
|
class NoopUpDownCounterMetric extends NoopMetric {
|
|
8724
|
-
add(_value, _attributes) {
|
|
8743
|
+
add(_value, _attributes) {
|
|
8744
|
+
}
|
|
8725
8745
|
}
|
|
8726
8746
|
exports.NoopUpDownCounterMetric = NoopUpDownCounterMetric;
|
|
8727
8747
|
|
|
8728
8748
|
class NoopGaugeMetric extends NoopMetric {
|
|
8729
|
-
record(_value, _attributes) {
|
|
8749
|
+
record(_value, _attributes) {
|
|
8750
|
+
}
|
|
8730
8751
|
}
|
|
8731
8752
|
exports.NoopGaugeMetric = NoopGaugeMetric;
|
|
8732
8753
|
|
|
8733
8754
|
class NoopHistogramMetric extends NoopMetric {
|
|
8734
|
-
record(_value, _attributes) {
|
|
8755
|
+
record(_value, _attributes) {
|
|
8756
|
+
}
|
|
8735
8757
|
}
|
|
8736
8758
|
exports.NoopHistogramMetric = NoopHistogramMetric;
|
|
8737
8759
|
|
|
8738
8760
|
class NoopObservableMetric {
|
|
8739
|
-
addCallback(_callback) {
|
|
8740
|
-
|
|
8761
|
+
addCallback(_callback) {
|
|
8762
|
+
}
|
|
8763
|
+
removeCallback(_callback) {
|
|
8764
|
+
}
|
|
8741
8765
|
}
|
|
8742
8766
|
exports.NoopObservableMetric = NoopObservableMetric;
|
|
8743
8767
|
|
|
@@ -8842,7 +8866,8 @@ var require_context2 = __commonJS((exports) => {
|
|
|
8842
8866
|
var NOOP_CONTEXT_MANAGER = new NoopContextManager_1.NoopContextManager;
|
|
8843
8867
|
|
|
8844
8868
|
class ContextAPI {
|
|
8845
|
-
constructor() {
|
|
8869
|
+
constructor() {
|
|
8870
|
+
}
|
|
8846
8871
|
static getInstance() {
|
|
8847
8872
|
if (!this._instance) {
|
|
8848
8873
|
this._instance = new ContextAPI;
|
|
@@ -8931,11 +8956,13 @@ var require_NonRecordingSpan = __commonJS((exports) => {
|
|
|
8931
8956
|
updateName(_name) {
|
|
8932
8957
|
return this;
|
|
8933
8958
|
}
|
|
8934
|
-
end(_endTime) {
|
|
8959
|
+
end(_endTime) {
|
|
8960
|
+
}
|
|
8935
8961
|
isRecording() {
|
|
8936
8962
|
return false;
|
|
8937
8963
|
}
|
|
8938
|
-
recordException(_exception, _time) {
|
|
8964
|
+
recordException(_exception, _time) {
|
|
8965
|
+
}
|
|
8939
8966
|
}
|
|
8940
8967
|
exports.NonRecordingSpan = NonRecordingSpan;
|
|
8941
8968
|
});
|
|
@@ -9237,7 +9264,8 @@ var require_tracestate_impl = __commonJS((exports) => {
|
|
|
9237
9264
|
const value = listMember.slice(i + 1, part.length);
|
|
9238
9265
|
if ((0, tracestate_validators_1.validateKey)(key) && (0, tracestate_validators_1.validateValue)(value)) {
|
|
9239
9266
|
agg.set(key, value);
|
|
9240
|
-
} else {
|
|
9267
|
+
} else {
|
|
9268
|
+
}
|
|
9241
9269
|
}
|
|
9242
9270
|
return agg;
|
|
9243
9271
|
}, new Map);
|
|
@@ -9309,7 +9337,8 @@ var require_metrics = __commonJS((exports) => {
|
|
|
9309
9337
|
var API_NAME2 = "metrics";
|
|
9310
9338
|
|
|
9311
9339
|
class MetricsAPI {
|
|
9312
|
-
constructor() {
|
|
9340
|
+
constructor() {
|
|
9341
|
+
}
|
|
9313
9342
|
static getInstance() {
|
|
9314
9343
|
if (!this._instance) {
|
|
9315
9344
|
this._instance = new MetricsAPI;
|
|
@@ -9346,7 +9375,8 @@ var require_NoopTextMapPropagator = __commonJS((exports) => {
|
|
|
9346
9375
|
exports.NoopTextMapPropagator = undefined;
|
|
9347
9376
|
|
|
9348
9377
|
class NoopTextMapPropagator {
|
|
9349
|
-
inject(_context, _carrier) {
|
|
9378
|
+
inject(_context, _carrier) {
|
|
9379
|
+
}
|
|
9350
9380
|
extract(context, _carrier) {
|
|
9351
9381
|
return context;
|
|
9352
9382
|
}
|
|
@@ -9659,7 +9689,8 @@ class Registry {
|
|
|
9659
9689
|
return this.kv.getByKey(identifier);
|
|
9660
9690
|
}
|
|
9661
9691
|
}
|
|
9662
|
-
var init_registry = () => {
|
|
9692
|
+
var init_registry = () => {
|
|
9693
|
+
};
|
|
9663
9694
|
|
|
9664
9695
|
// node_modules/superjson/dist/class-registry.js
|
|
9665
9696
|
var ClassRegistry;
|
|
@@ -9744,7 +9775,8 @@ class CustomTransformerRegistry {
|
|
|
9744
9775
|
return this.transfomers[name2];
|
|
9745
9776
|
}
|
|
9746
9777
|
}
|
|
9747
|
-
var init_custom_transformer_registry = () => {
|
|
9778
|
+
var init_custom_transformer_registry = () => {
|
|
9779
|
+
};
|
|
9748
9780
|
|
|
9749
9781
|
// node_modules/superjson/dist/is.js
|
|
9750
9782
|
var getType = (payload) => Object.prototype.toString.call(payload).slice(8, -1), isUndefined = (payload) => typeof payload === "undefined", isNull = (payload) => payload === null, isPlainObject = (payload) => {
|
|
@@ -10089,7 +10121,8 @@ var getNthKey = (value, n) => {
|
|
|
10089
10121
|
}
|
|
10090
10122
|
return object2;
|
|
10091
10123
|
};
|
|
10092
|
-
var init_accessDeep = () => {
|
|
10124
|
+
var init_accessDeep = () => {
|
|
10125
|
+
};
|
|
10093
10126
|
|
|
10094
10127
|
// node_modules/superjson/dist/plainer.js
|
|
10095
10128
|
function traverse(tree, walker, origin = []) {
|
|
@@ -10678,7 +10711,8 @@ var require_NoopLogger = __commonJS((exports) => {
|
|
|
10678
10711
|
exports.NOOP_LOGGER = exports.NoopLogger = undefined;
|
|
10679
10712
|
|
|
10680
10713
|
class NoopLogger {
|
|
10681
|
-
emit(_logRecord) {
|
|
10714
|
+
emit(_logRecord) {
|
|
10715
|
+
}
|
|
10682
10716
|
}
|
|
10683
10717
|
exports.NoopLogger = NoopLogger;
|
|
10684
10718
|
exports.NOOP_LOGGER = new NoopLogger;
|
|
@@ -10772,7 +10806,8 @@ var require_logs = __commonJS((exports) => {
|
|
|
10772
10806
|
var NoopLoggerProvider_1 = require_NoopLoggerProvider();
|
|
10773
10807
|
|
|
10774
10808
|
class LogsAPI {
|
|
10775
|
-
constructor() {
|
|
10809
|
+
constructor() {
|
|
10810
|
+
}
|
|
10776
10811
|
static getInstance() {
|
|
10777
10812
|
if (!this._instance) {
|
|
10778
10813
|
this._instance = new LogsAPI;
|
|
@@ -11240,7 +11275,8 @@ var require_browser = __commonJS((exports, module) => {
|
|
|
11240
11275
|
});
|
|
11241
11276
|
args.splice(lastC, 0, c);
|
|
11242
11277
|
}
|
|
11243
|
-
exports.log = console.debug || console.log || (() => {
|
|
11278
|
+
exports.log = console.debug || console.log || (() => {
|
|
11279
|
+
});
|
|
11244
11280
|
function save(namespaces) {
|
|
11245
11281
|
try {
|
|
11246
11282
|
if (namespaces) {
|
|
@@ -11248,13 +11284,15 @@ var require_browser = __commonJS((exports, module) => {
|
|
|
11248
11284
|
} else {
|
|
11249
11285
|
exports.storage.removeItem("debug");
|
|
11250
11286
|
}
|
|
11251
|
-
} catch (error) {
|
|
11287
|
+
} catch (error) {
|
|
11288
|
+
}
|
|
11252
11289
|
}
|
|
11253
11290
|
function load() {
|
|
11254
11291
|
let r;
|
|
11255
11292
|
try {
|
|
11256
11293
|
r = exports.storage.getItem("debug");
|
|
11257
|
-
} catch (error) {
|
|
11294
|
+
} catch (error) {
|
|
11295
|
+
}
|
|
11258
11296
|
if (!r && typeof process !== "undefined" && "env" in process) {
|
|
11259
11297
|
r = process.env.DEBUG;
|
|
11260
11298
|
}
|
|
@@ -11263,7 +11301,8 @@ var require_browser = __commonJS((exports, module) => {
|
|
|
11263
11301
|
function localstorage() {
|
|
11264
11302
|
try {
|
|
11265
11303
|
return localStorage;
|
|
11266
|
-
} catch (error) {
|
|
11304
|
+
} catch (error) {
|
|
11305
|
+
}
|
|
11267
11306
|
}
|
|
11268
11307
|
module.exports = require_common()(exports);
|
|
11269
11308
|
var { formatters } = module.exports;
|
|
@@ -11395,7 +11434,8 @@ var require_node3 = __commonJS((exports, module) => {
|
|
|
11395
11434
|
exports.save = save;
|
|
11396
11435
|
exports.load = load;
|
|
11397
11436
|
exports.useColors = useColors;
|
|
11398
|
-
exports.destroy = util5.deprecate(() => {
|
|
11437
|
+
exports.destroy = util5.deprecate(() => {
|
|
11438
|
+
}, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
11399
11439
|
exports.colors = [6, 2, 3, 4, 5, 1];
|
|
11400
11440
|
try {
|
|
11401
11441
|
const supportsColor = require_supports_color();
|
|
@@ -11479,7 +11519,8 @@ var require_node3 = __commonJS((exports, module) => {
|
|
|
11479
11519
|
221
|
|
11480
11520
|
];
|
|
11481
11521
|
}
|
|
11482
|
-
} catch (error) {
|
|
11522
|
+
} catch (error) {
|
|
11523
|
+
}
|
|
11483
11524
|
exports.inspectOpts = Object.keys(process.env).filter((key) => {
|
|
11484
11525
|
return /^debug_/i.test(key);
|
|
11485
11526
|
}).reduce((obj, key) => {
|
|
@@ -13728,7 +13769,8 @@ var require_jsbn = __commonJS((exports, module) => {
|
|
|
13728
13769
|
++this[w];
|
|
13729
13770
|
}
|
|
13730
13771
|
}
|
|
13731
|
-
function NullExp() {
|
|
13772
|
+
function NullExp() {
|
|
13773
|
+
}
|
|
13732
13774
|
function nNop(x) {
|
|
13733
13775
|
return x;
|
|
13734
13776
|
}
|
|
@@ -14153,7 +14195,8 @@ var require_jsbn = __commonJS((exports, module) => {
|
|
|
14153
14195
|
for (i2 = 0;i2 < ba.length; ++i2)
|
|
14154
14196
|
ba[i2] = rng_get_byte();
|
|
14155
14197
|
}
|
|
14156
|
-
function SecureRandom() {
|
|
14198
|
+
function SecureRandom() {
|
|
14199
|
+
}
|
|
14157
14200
|
SecureRandom.prototype.nextBytes = rng_get_bytes;
|
|
14158
14201
|
function Arcfour() {
|
|
14159
14202
|
this.i = 0;
|
|
@@ -16376,7 +16419,8 @@ var require_delayed_stream = __commonJS((exports, module) => {
|
|
|
16376
16419
|
delayedStream._handleEmit(arguments);
|
|
16377
16420
|
return realEmit.apply(source, arguments);
|
|
16378
16421
|
};
|
|
16379
|
-
source.on("error", function() {
|
|
16422
|
+
source.on("error", function() {
|
|
16423
|
+
});
|
|
16380
16424
|
if (delayedStream.pauseStream) {
|
|
16381
16425
|
source.pause();
|
|
16382
16426
|
}
|
|
@@ -25680,7 +25724,8 @@ var require_implementation = __commonJS((exports, module) => {
|
|
|
25680
25724
|
}
|
|
25681
25725
|
bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
|
|
25682
25726
|
if (target.prototype) {
|
|
25683
|
-
var Empty = function Empty() {
|
|
25727
|
+
var Empty = function Empty() {
|
|
25728
|
+
};
|
|
25684
25729
|
Empty.prototype = target.prototype;
|
|
25685
25730
|
bound.prototype = new Empty;
|
|
25686
25731
|
Empty.prototype = null;
|
|
@@ -25800,7 +25845,8 @@ var require_get_intrinsic = __commonJS((exports, module) => {
|
|
|
25800
25845
|
var getEvalledConstructor = function(expressionSyntax) {
|
|
25801
25846
|
try {
|
|
25802
25847
|
return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")();
|
|
25803
|
-
} catch (e2) {
|
|
25848
|
+
} catch (e2) {
|
|
25849
|
+
}
|
|
25804
25850
|
};
|
|
25805
25851
|
var $gOPD = require_gopd();
|
|
25806
25852
|
var $defineProperty = require_es_define_property();
|
|
@@ -26539,9 +26585,11 @@ var require_debug = __commonJS((exports, module) => {
|
|
|
26539
26585
|
if (!debug) {
|
|
26540
26586
|
try {
|
|
26541
26587
|
debug = require_src4()("follow-redirects");
|
|
26542
|
-
} catch (error) {
|
|
26588
|
+
} catch (error) {
|
|
26589
|
+
}
|
|
26543
26590
|
if (typeof debug !== "function") {
|
|
26544
|
-
debug = function() {
|
|
26591
|
+
debug = function() {
|
|
26592
|
+
};
|
|
26545
26593
|
}
|
|
26546
26594
|
}
|
|
26547
26595
|
debug.apply(null, arguments);
|
|
@@ -26916,7 +26964,8 @@ var require_follow_redirects = __commonJS((exports, module) => {
|
|
|
26916
26964
|
});
|
|
26917
26965
|
return exports2;
|
|
26918
26966
|
}
|
|
26919
|
-
function noop2() {
|
|
26967
|
+
function noop2() {
|
|
26968
|
+
}
|
|
26920
26969
|
function parseUrl(input) {
|
|
26921
26970
|
var parsed;
|
|
26922
26971
|
if (useNativeURL) {
|
|
@@ -27299,7 +27348,8 @@ var require_axios = __commonJS((exports, module) => {
|
|
|
27299
27348
|
isArray3(arrayOrString) ? define2(arrayOrString) : define2(String(arrayOrString).split(delimiter));
|
|
27300
27349
|
return obj;
|
|
27301
27350
|
};
|
|
27302
|
-
var noop2 = () => {
|
|
27351
|
+
var noop2 = () => {
|
|
27352
|
+
};
|
|
27303
27353
|
var toFiniteNumber = (value2, defaultValue) => {
|
|
27304
27354
|
return value2 != null && Number.isFinite(value2 = +value2) ? value2 : defaultValue;
|
|
27305
27355
|
};
|
|
@@ -28752,7 +28802,8 @@ var require_axios = __commonJS((exports, module) => {
|
|
|
28752
28802
|
try {
|
|
28753
28803
|
const knownLength = await util__default["default"].promisify(data.getLength).call(data);
|
|
28754
28804
|
Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);
|
|
28755
|
-
} catch (e2) {
|
|
28805
|
+
} catch (e2) {
|
|
28806
|
+
}
|
|
28756
28807
|
}
|
|
28757
28808
|
} else if (utils$1.isBlob(data) || utils$1.isFile(data)) {
|
|
28758
28809
|
data.size && headers.setContentType(data.type || "application/octet-stream");
|
|
@@ -29026,11 +29077,13 @@ var require_axios = __commonJS((exports, module) => {
|
|
|
29026
29077
|
this.write(name2, "", Date.now() - 86400000);
|
|
29027
29078
|
}
|
|
29028
29079
|
} : {
|
|
29029
|
-
write() {
|
|
29080
|
+
write() {
|
|
29081
|
+
},
|
|
29030
29082
|
read() {
|
|
29031
29083
|
return null;
|
|
29032
29084
|
},
|
|
29033
|
-
remove() {
|
|
29085
|
+
remove() {
|
|
29086
|
+
}
|
|
29034
29087
|
};
|
|
29035
29088
|
var headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
|
|
29036
29089
|
function mergeConfig(config1, config2) {
|
|
@@ -29524,7 +29577,8 @@ var require_axios = __commonJS((exports, module) => {
|
|
|
29524
29577
|
if (fn) {
|
|
29525
29578
|
try {
|
|
29526
29579
|
Object.defineProperty(fn, "name", { value: value2 });
|
|
29527
|
-
} catch (e2) {
|
|
29580
|
+
} catch (e2) {
|
|
29581
|
+
}
|
|
29528
29582
|
Object.defineProperty(fn, "adapterName", { value: value2 });
|
|
29529
29583
|
}
|
|
29530
29584
|
});
|
|
@@ -29674,7 +29728,8 @@ var require_axios = __commonJS((exports, module) => {
|
|
|
29674
29728
|
err.stack += `
|
|
29675
29729
|
` + stack;
|
|
29676
29730
|
}
|
|
29677
|
-
} catch (e2) {
|
|
29731
|
+
} catch (e2) {
|
|
29732
|
+
}
|
|
29678
29733
|
}
|
|
29679
29734
|
throw err;
|
|
29680
29735
|
}
|
|
@@ -31747,7 +31802,8 @@ var require_logger = __commonJS((exports) => {
|
|
|
31747
31802
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31748
31803
|
exports.DefaultLogger = undefined;
|
|
31749
31804
|
exports.DefaultLogger = {
|
|
31750
|
-
silly: (...params) => {
|
|
31805
|
+
silly: (...params) => {
|
|
31806
|
+
},
|
|
31751
31807
|
debug: (...params) => {
|
|
31752
31808
|
console.log(new Date, params);
|
|
31753
31809
|
},
|
|
@@ -34490,7 +34546,8 @@ var require_constants4 = __commonJS((exports, module) => {
|
|
|
34490
34546
|
kListener: Symbol("kListener"),
|
|
34491
34547
|
kStatusCode: Symbol("status-code"),
|
|
34492
34548
|
kWebSocket: Symbol("websocket"),
|
|
34493
|
-
NOOP: () => {
|
|
34549
|
+
NOOP: () => {
|
|
34550
|
+
}
|
|
34494
34551
|
};
|
|
34495
34552
|
});
|
|
34496
34553
|
|
|
@@ -34568,7 +34625,8 @@ var require_buffer_util = __commonJS((exports, module) => {
|
|
|
34568
34625
|
else
|
|
34569
34626
|
bufferUtil.unmask(buffer, mask);
|
|
34570
34627
|
};
|
|
34571
|
-
} catch (e2) {
|
|
34628
|
+
} catch (e2) {
|
|
34629
|
+
}
|
|
34572
34630
|
}
|
|
34573
34631
|
});
|
|
34574
34632
|
|
|
@@ -35047,7 +35105,8 @@ var require_validation = __commonJS((exports, module) => {
|
|
|
35047
35105
|
module.exports.isValidUTF8 = function(buf) {
|
|
35048
35106
|
return buf.length < 32 ? _isValidUTF8(buf) : isValidUTF8(buf);
|
|
35049
35107
|
};
|
|
35050
|
-
} catch (e2) {
|
|
35108
|
+
} catch (e2) {
|
|
35109
|
+
}
|
|
35051
35110
|
}
|
|
35052
35111
|
});
|
|
35053
35112
|
|
|
@@ -37472,7 +37531,8 @@ var require_websocket_client = __commonJS((exports) => {
|
|
|
37472
37531
|
this.options = Object.assign({ pongTimeout: 7500, pingInterval: 1e4, reconnectTimeout: 500 }, options);
|
|
37473
37532
|
this.listenKeyStateStore = {};
|
|
37474
37533
|
this.wsUrlKeyMap = {};
|
|
37475
|
-
this.on("error", () => {
|
|
37534
|
+
this.on("error", () => {
|
|
37535
|
+
});
|
|
37476
37536
|
}
|
|
37477
37537
|
getRestClientOptions() {
|
|
37478
37538
|
return Object.assign(Object.assign(Object.assign({}, this.options), this.options.restOptions), { api_key: this.options.api_key, api_secret: this.options.api_secret });
|
|
@@ -38889,7 +38949,8 @@ var require_logger2 = __commonJS((exports) => {
|
|
|
38889
38949
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38890
38950
|
exports.DefaultLogger = undefined;
|
|
38891
38951
|
exports.DefaultLogger = {
|
|
38892
|
-
trace: (..._params) => {
|
|
38952
|
+
trace: (..._params) => {
|
|
38953
|
+
},
|
|
38893
38954
|
info: (...params) => {
|
|
38894
38955
|
console.info(params);
|
|
38895
38956
|
},
|
|
@@ -40935,7 +40996,8 @@ var require_BaseWSClient = __commonJS((exports) => {
|
|
|
40935
40996
|
if (wsState === null || wsState === undefined ? undefined : wsState.activePongTimer) {
|
|
40936
40997
|
clearTimeout(wsState.activePongTimer);
|
|
40937
40998
|
wsState.activePongTimer = undefined;
|
|
40938
|
-
} else {
|
|
40999
|
+
} else {
|
|
41000
|
+
}
|
|
40939
41001
|
}
|
|
40940
41002
|
clearReconnectTimer(wsKey) {
|
|
40941
41003
|
const wsState = this.wsStore.get(wsKey);
|
|
@@ -41806,7 +41868,8 @@ var require_lib3 = __commonJS((exports) => {
|
|
|
41806
41868
|
var util;
|
|
41807
41869
|
(function(util2) {
|
|
41808
41870
|
util2.assertEqual = (val) => val;
|
|
41809
|
-
function assertIs(_arg) {
|
|
41871
|
+
function assertIs(_arg) {
|
|
41872
|
+
}
|
|
41810
41873
|
util2.assertIs = assertIs;
|
|
41811
41874
|
function assertNever(_x) {
|
|
41812
41875
|
throw new Error;
|
|
@@ -47161,7 +47224,8 @@ function parseStringDef(def, refs) {
|
|
|
47161
47224
|
case "trim":
|
|
47162
47225
|
break;
|
|
47163
47226
|
default:
|
|
47164
|
-
((_) => {
|
|
47227
|
+
((_) => {
|
|
47228
|
+
})(check);
|
|
47165
47229
|
}
|
|
47166
47230
|
}
|
|
47167
47231
|
}
|
|
@@ -48551,7 +48615,8 @@ class StdioServerTransport {
|
|
|
48551
48615
|
var util2;
|
|
48552
48616
|
(function(util3) {
|
|
48553
48617
|
util3.assertEqual = (val) => val;
|
|
48554
|
-
function assertIs(_arg) {
|
|
48618
|
+
function assertIs(_arg) {
|
|
48619
|
+
}
|
|
48555
48620
|
util3.assertIs = assertIs;
|
|
48556
48621
|
function assertNever(_x) {
|
|
48557
48622
|
throw new Error;
|
|
@@ -53412,7 +53477,8 @@ var API_NAME = "task-context";
|
|
|
53412
53477
|
|
|
53413
53478
|
class TaskContextAPI {
|
|
53414
53479
|
static _instance;
|
|
53415
|
-
constructor() {
|
|
53480
|
+
constructor() {
|
|
53481
|
+
}
|
|
53416
53482
|
static getInstance() {
|
|
53417
53483
|
if (!this._instance) {
|
|
53418
53484
|
this._instance = new TaskContextAPI;
|
|
@@ -53832,7 +53898,8 @@ class ParseError extends Error {
|
|
|
53832
53898
|
super(message2), this.name = "ParseError", this.type = options.type, this.field = options.field, this.value = options.value, this.line = options.line;
|
|
53833
53899
|
}
|
|
53834
53900
|
}
|
|
53835
|
-
function noop(_arg) {
|
|
53901
|
+
function noop(_arg) {
|
|
53902
|
+
}
|
|
53836
53903
|
function createParser(callbacks) {
|
|
53837
53904
|
if (typeof callbacks == "function")
|
|
53838
53905
|
throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");
|
|
@@ -54035,7 +54102,8 @@ async function _doZodFetchWithRetries(schema, url, requestInit, options, attempt
|
|
|
54035
54102
|
if (error instanceof ApiError) {
|
|
54036
54103
|
throw error;
|
|
54037
54104
|
}
|
|
54038
|
-
if (error instanceof import_zod_validation_error.ValidationError) {
|
|
54105
|
+
if (error instanceof import_zod_validation_error.ValidationError) {
|
|
54106
|
+
}
|
|
54039
54107
|
if (options?.retry) {
|
|
54040
54108
|
const retry = { ...defaultRetryOptions2, ...options.retry };
|
|
54041
54109
|
const delay = calculateNextRetryDelay(retry, attempt);
|
|
@@ -54509,7 +54577,8 @@ class ApiClientMissingError extends Error {
|
|
|
54509
54577
|
|
|
54510
54578
|
class APIClientManagerAPI {
|
|
54511
54579
|
static _instance;
|
|
54512
|
-
constructor() {
|
|
54580
|
+
constructor() {
|
|
54581
|
+
}
|
|
54513
54582
|
static getInstance() {
|
|
54514
54583
|
if (!this._instance) {
|
|
54515
54584
|
this._instance = new APIClientManagerAPI;
|
|
@@ -55064,7 +55133,8 @@ var PrefetchQueue = class {
|
|
|
55064
55133
|
if (__privateGet(this, _queueTailUrl) && !__privateGet(this, _prefetchQueue).has(__privateGet(this, _queueTailUrl))) {
|
|
55065
55134
|
__privateMethod(this, _PrefetchQueue_instances, prefetch_fn).call(this, __privateGet(this, _queueTailUrl), args[1]);
|
|
55066
55135
|
}
|
|
55067
|
-
}).catch(() => {
|
|
55136
|
+
}).catch(() => {
|
|
55137
|
+
});
|
|
55068
55138
|
return request;
|
|
55069
55139
|
}
|
|
55070
55140
|
};
|
|
@@ -55095,8 +55165,10 @@ prefetch_fn = function(...args) {
|
|
|
55095
55165
|
}
|
|
55096
55166
|
__privateSet(this, _queueTailUrl, nextUrl);
|
|
55097
55167
|
return __privateMethod(this, _PrefetchQueue_instances, prefetch_fn).call(this, nextUrl, args[1]);
|
|
55098
|
-
}).catch(() => {
|
|
55099
|
-
|
|
55168
|
+
}).catch(() => {
|
|
55169
|
+
});
|
|
55170
|
+
} catch (_) {
|
|
55171
|
+
}
|
|
55100
55172
|
};
|
|
55101
55173
|
function getNextChunkUrl(url, res) {
|
|
55102
55174
|
const shapeHandle = res.headers.get(SHAPE_HANDLE_HEADER);
|
|
@@ -55199,7 +55271,8 @@ var ShapeStream = class {
|
|
|
55199
55271
|
get lastOffset() {
|
|
55200
55272
|
return __privateGet(this, _lastOffset);
|
|
55201
55273
|
}
|
|
55202
|
-
subscribe(callback, onError = () => {
|
|
55274
|
+
subscribe(callback, onError = () => {
|
|
55275
|
+
}) {
|
|
55203
55276
|
const subscriptionId = Math.random();
|
|
55204
55277
|
__privateGet(this, _subscribers).set(subscriptionId, [callback, onError]);
|
|
55205
55278
|
return () => {
|
|
@@ -56393,7 +56466,8 @@ class SimpleClock {
|
|
|
56393
56466
|
const nowStruct = now.toStruct();
|
|
56394
56467
|
return [nowStruct.seconds, nowStruct.nanos];
|
|
56395
56468
|
}
|
|
56396
|
-
reset() {
|
|
56469
|
+
reset() {
|
|
56470
|
+
}
|
|
56397
56471
|
}
|
|
56398
56472
|
|
|
56399
56473
|
// node_modules/@trigger.dev/core/dist/esm/v3/clock/index.js
|
|
@@ -56402,7 +56476,8 @@ var SIMPLE_CLOCK = new SimpleClock;
|
|
|
56402
56476
|
|
|
56403
56477
|
class ClockAPI {
|
|
56404
56478
|
static _instance;
|
|
56405
|
-
constructor() {
|
|
56479
|
+
constructor() {
|
|
56480
|
+
}
|
|
56406
56481
|
static getInstance() {
|
|
56407
56482
|
if (!this._instance) {
|
|
56408
56483
|
this._instance = new ClockAPI;
|
|
@@ -56428,7 +56503,8 @@ var clock = ClockAPI.getInstance();
|
|
|
56428
56503
|
|
|
56429
56504
|
// node_modules/@trigger.dev/core/dist/esm/v3/usage/noopUsageManager.js
|
|
56430
56505
|
class NoopUsageManager {
|
|
56431
|
-
disable() {
|
|
56506
|
+
disable() {
|
|
56507
|
+
}
|
|
56432
56508
|
start() {
|
|
56433
56509
|
return {
|
|
56434
56510
|
sample: () => ({ cpuTime: 0, wallTime: 0 })
|
|
@@ -56451,7 +56527,8 @@ var NOOP_USAGE_MANAGER = new NoopUsageManager;
|
|
|
56451
56527
|
|
|
56452
56528
|
class UsageAPI {
|
|
56453
56529
|
static _instance;
|
|
56454
|
-
constructor() {
|
|
56530
|
+
constructor() {
|
|
56531
|
+
}
|
|
56455
56532
|
static getInstance() {
|
|
56456
56533
|
if (!this._instance) {
|
|
56457
56534
|
this._instance = new UsageAPI;
|
|
@@ -56511,7 +56588,8 @@ class NoopRunMetadataManager {
|
|
|
56511
56588
|
refresh(requestOptions) {
|
|
56512
56589
|
throw new Error("Method not implemented.");
|
|
56513
56590
|
}
|
|
56514
|
-
enterWithMetadata(metadata) {
|
|
56591
|
+
enterWithMetadata(metadata) {
|
|
56592
|
+
}
|
|
56515
56593
|
current() {
|
|
56516
56594
|
throw new Error("Method not implemented.");
|
|
56517
56595
|
}
|
|
@@ -56567,7 +56645,8 @@ var NOOP_MANAGER = new NoopRunMetadataManager;
|
|
|
56567
56645
|
|
|
56568
56646
|
class RunMetadataAPI {
|
|
56569
56647
|
static _instance;
|
|
56570
|
-
constructor() {
|
|
56648
|
+
constructor() {
|
|
56649
|
+
}
|
|
56571
56650
|
static getInstance() {
|
|
56572
56651
|
if (!this._instance) {
|
|
56573
56652
|
this._instance = new RunMetadataAPI;
|
|
@@ -56652,7 +56731,8 @@ var NOOP_TIMEOUT_MANAGER = new NoopTimeoutManager;
|
|
|
56652
56731
|
|
|
56653
56732
|
class TimeoutAPI {
|
|
56654
56733
|
static _instance;
|
|
56655
|
-
constructor() {
|
|
56734
|
+
constructor() {
|
|
56735
|
+
}
|
|
56656
56736
|
static getInstance() {
|
|
56657
56737
|
if (!this._instance) {
|
|
56658
56738
|
this._instance = new TimeoutAPI;
|
|
@@ -57056,7 +57136,8 @@ function getTokenPayload(e2) {
|
|
|
57056
57136
|
return "%" + ("00" + e3.charCodeAt(0).toString(16)).slice(-2);
|
|
57057
57137
|
}).join(""));
|
|
57058
57138
|
return JSON.parse(t2) || {};
|
|
57059
|
-
} catch (e3) {
|
|
57139
|
+
} catch (e3) {
|
|
57140
|
+
}
|
|
57060
57141
|
return {};
|
|
57061
57142
|
}
|
|
57062
57143
|
function isTokenExpired(e2, t2 = 0) {
|
|
@@ -57110,7 +57191,8 @@ class BaseAuthStore {
|
|
|
57110
57191
|
let n = {};
|
|
57111
57192
|
try {
|
|
57112
57193
|
n = JSON.parse(s2), (typeof n === null || typeof n != "object" || Array.isArray(n)) && (n = {});
|
|
57113
|
-
} catch (e3) {
|
|
57194
|
+
} catch (e3) {
|
|
57195
|
+
}
|
|
57114
57196
|
this.save(n.token || "", n.record || n.model || null);
|
|
57115
57197
|
}
|
|
57116
57198
|
exportToCookie(e2, t2 = i) {
|
|
@@ -57257,7 +57339,8 @@ class RealtimeService extends BaseService {
|
|
|
57257
57339
|
let i3;
|
|
57258
57340
|
try {
|
|
57259
57341
|
i3 = JSON.parse(s3?.data);
|
|
57260
|
-
} catch {
|
|
57342
|
+
} catch {
|
|
57343
|
+
}
|
|
57261
57344
|
t2(i3 || {});
|
|
57262
57345
|
};
|
|
57263
57346
|
return this.subscriptions[i2] || (this.subscriptions[i2] = []), this.subscriptions[i2].push(listener), this.isConnected ? this.subscriptions[i2].length === 1 ? await this.submitSubscriptions() : this.eventSource?.addEventListener(i2, listener) : await this.connect(), async () => this.unsubscribeByTopicAndListener(e2, listener);
|
|
@@ -57970,7 +58053,8 @@ class Client {
|
|
|
57970
58053
|
let s3 = {};
|
|
57971
58054
|
try {
|
|
57972
58055
|
s3 = await e3.json();
|
|
57973
|
-
} catch (e4) {
|
|
58056
|
+
} catch (e4) {
|
|
58057
|
+
}
|
|
57974
58058
|
if (this.afterSend && (s3 = await this.afterSend(e3, s3, t2)), e3.status >= 400)
|
|
57975
58059
|
throw new ClientResponseError({ url: e3.url, status: e3.status, data: s3 });
|
|
57976
58060
|
return s3;
|
|
@@ -58602,6 +58686,91 @@ class AppDatabase {
|
|
|
58602
58686
|
}
|
|
58603
58687
|
return null;
|
|
58604
58688
|
}
|
|
58689
|
+
async getBotViewInstance(payload) {
|
|
58690
|
+
const { asset, main_account } = payload;
|
|
58691
|
+
const bot_instances = await this.pb.collection("bot_view").getFullList({
|
|
58692
|
+
filter: `main_symbol:lower="${asset.toLowerCase()}" && main_account.owner:lower="${main_account.owner.toLowerCase()}" && main_account.exchange:lower="${main_account.exchange.toLowerCase()}"`,
|
|
58693
|
+
expand: "main_account,secondary_account,main_long_strategy,main_short_strategy,secondary_long_strategy,secondary_short_strategy"
|
|
58694
|
+
});
|
|
58695
|
+
if (bot_instances.length > 0) {
|
|
58696
|
+
const instance = bot_instances[0];
|
|
58697
|
+
const {
|
|
58698
|
+
main_account: main_account2,
|
|
58699
|
+
secondary_account,
|
|
58700
|
+
main_long_strategy,
|
|
58701
|
+
main_short_strategy,
|
|
58702
|
+
secondary_long_strategy,
|
|
58703
|
+
secondary_short_strategy
|
|
58704
|
+
} = instance.expand;
|
|
58705
|
+
return {
|
|
58706
|
+
...instance,
|
|
58707
|
+
main: {
|
|
58708
|
+
account: main_account2,
|
|
58709
|
+
symbol: instance.main_symbol,
|
|
58710
|
+
strategy: {
|
|
58711
|
+
long: main_long_strategy,
|
|
58712
|
+
short: main_short_strategy
|
|
58713
|
+
},
|
|
58714
|
+
position: {
|
|
58715
|
+
long: instance.main_long_position,
|
|
58716
|
+
short: instance.main_short_position
|
|
58717
|
+
}
|
|
58718
|
+
},
|
|
58719
|
+
secondary: {
|
|
58720
|
+
account: secondary_account,
|
|
58721
|
+
symbol: instance.secondary_symbol,
|
|
58722
|
+
strategy: {
|
|
58723
|
+
long: secondary_long_strategy,
|
|
58724
|
+
short: secondary_short_strategy
|
|
58725
|
+
},
|
|
58726
|
+
position: {
|
|
58727
|
+
long: instance.secondary_long_position,
|
|
58728
|
+
short: instance.secondary_short_position
|
|
58729
|
+
}
|
|
58730
|
+
}
|
|
58731
|
+
};
|
|
58732
|
+
}
|
|
58733
|
+
return null;
|
|
58734
|
+
}
|
|
58735
|
+
async getBotInstance(payload) {
|
|
58736
|
+
const { asset, main_account } = payload;
|
|
58737
|
+
const bot_instances = await this.pb.collection("bot_instances").getFullList({
|
|
58738
|
+
filter: `asset:lower="${asset.toLowerCase()}" && main_account.owner:lower="${main_account.owner.toLowerCase()}" && main_account.exchange:lower="${main_account.exchange.toLowerCase()}"`
|
|
58739
|
+
});
|
|
58740
|
+
if (bot_instances.length > 0) {
|
|
58741
|
+
return bot_instances[0];
|
|
58742
|
+
}
|
|
58743
|
+
return null;
|
|
58744
|
+
}
|
|
58745
|
+
async getBotState(payload) {
|
|
58746
|
+
const { asset, main_account, running } = payload;
|
|
58747
|
+
let filter = `bot.asset:lower="${asset.toLowerCase()}" && bot.main_account.owner:lower="${main_account.owner.toLowerCase()}" && bot.main_account.exchange:lower="${main_account.exchange.toLowerCase()}"`;
|
|
58748
|
+
if (running !== undefined) {
|
|
58749
|
+
filter += ` && running=${running}`;
|
|
58750
|
+
}
|
|
58751
|
+
const bot_states = await this.pb.collection("bot_states").getFullList({
|
|
58752
|
+
filter
|
|
58753
|
+
});
|
|
58754
|
+
return bot_states;
|
|
58755
|
+
}
|
|
58756
|
+
async getBotOrderHistories(payload) {
|
|
58757
|
+
const { asset, main_account, symbol, kind, type } = payload;
|
|
58758
|
+
let filter = `field.bot.asset:lower="${asset.toLowerCase()}" && field.bot.main_account.owner:lower="${main_account.owner.toLowerCase()}" && field.bot.main_account.exchange:lower="${main_account.exchange.toLowerCase()}"`;
|
|
58759
|
+
if (symbol) {
|
|
58760
|
+
filter += ` && symbol:lower="${symbol.toLowerCase()}"`;
|
|
58761
|
+
}
|
|
58762
|
+
if (kind) {
|
|
58763
|
+
filter += ` && kind="${kind}"`;
|
|
58764
|
+
}
|
|
58765
|
+
if (type) {
|
|
58766
|
+
filter += ` && type="${type}"`;
|
|
58767
|
+
}
|
|
58768
|
+
const bot_order_histories = await this.pb.collection("bot_order_history").getFullList({
|
|
58769
|
+
filter,
|
|
58770
|
+
sort: "-created"
|
|
58771
|
+
});
|
|
58772
|
+
return bot_order_histories;
|
|
58773
|
+
}
|
|
58605
58774
|
async createOrUpdateWindingDownMarket(payload) {
|
|
58606
58775
|
const { symbol, risk_reward = 30 } = payload;
|
|
58607
58776
|
const existing_winding_down_market = await this.pb.collection("winding_down_markets").getFullList({
|
|
@@ -59267,7 +59436,8 @@ class Signal {
|
|
|
59267
59436
|
support: kind === "long" ? _stop_loss : this.support
|
|
59268
59437
|
};
|
|
59269
59438
|
const instance = new Signal(derivedConfig);
|
|
59270
|
-
if (kind === "short") {
|
|
59439
|
+
if (kind === "short") {
|
|
59440
|
+
}
|
|
59271
59441
|
let result = instance.get_bulk_trade_zones({ current_price, kind });
|
|
59272
59442
|
return result;
|
|
59273
59443
|
return result?.filter((x) => {
|
|
@@ -59485,7 +59655,8 @@ class Signal {
|
|
|
59485
59655
|
kind = "long",
|
|
59486
59656
|
raw
|
|
59487
59657
|
}) {
|
|
59488
|
-
if (raw) {
|
|
59658
|
+
if (raw) {
|
|
59659
|
+
}
|
|
59489
59660
|
const margin_range = this.get_margin_range(current_price, kind);
|
|
59490
59661
|
let margin_zones = this.get_margin_zones({ current_price });
|
|
59491
59662
|
let remaining_zones = margin_zones.filter((x) => JSON.stringify(x) != JSON.stringify(margin_range));
|
|
@@ -59696,7 +59867,8 @@ class Signal {
|
|
|
59696
59867
|
return true;
|
|
59697
59868
|
});
|
|
59698
59869
|
let total_orders = limit_trades.concat(market_trades);
|
|
59699
|
-
if (kind === "short") {
|
|
59870
|
+
if (kind === "short") {
|
|
59871
|
+
}
|
|
59700
59872
|
if (this.minimum_size && total_orders.length > 0) {
|
|
59701
59873
|
let payload = total_orders;
|
|
59702
59874
|
let greater_than_min_size = total_orders.filter((o) => o ? o.quantity >= this.minimum_size : true);
|
|
@@ -59782,7 +59954,8 @@ class Signal {
|
|
|
59782
59954
|
});
|
|
59783
59955
|
const multiplier = start - index;
|
|
59784
59956
|
const incurred_fees = fees.reduce((a, b) => a + b, 0) + previous_risks.reduce((a, b) => a + b, 0);
|
|
59785
|
-
if (index === 0) {
|
|
59957
|
+
if (index === 0) {
|
|
59958
|
+
}
|
|
59786
59959
|
let quantity = determine_position_size2({
|
|
59787
59960
|
entry,
|
|
59788
59961
|
stop,
|
|
@@ -59880,7 +60053,8 @@ function buildConfig(app_config, {
|
|
|
59880
60053
|
return [];
|
|
59881
60054
|
}
|
|
59882
60055
|
const condition = (kind === "long" ? entry > app_config.support : entry >= app_config.support) && stop >= app_config.support * 0.999;
|
|
59883
|
-
if (kind === "short") {
|
|
60056
|
+
if (kind === "short") {
|
|
60057
|
+
}
|
|
59884
60058
|
const result = entry === stop ? [] : condition ? instance.build_entry({
|
|
59885
60059
|
current_price: entry,
|
|
59886
60060
|
stop_loss: stop,
|
|
@@ -61046,8 +61220,11 @@ class Strategy {
|
|
|
61046
61220
|
}
|
|
61047
61221
|
}
|
|
61048
61222
|
};
|
|
61049
|
-
results.push(to_add);
|
|
61050
61223
|
const sell_kind = direction == "long" ? "short" : "long";
|
|
61224
|
+
if (sell_quantity[sell_kind] <= 0) {
|
|
61225
|
+
break;
|
|
61226
|
+
}
|
|
61227
|
+
results.push(to_add);
|
|
61051
61228
|
const remaining = this.to_df(params[sell_kind].quantity - sell_quantity[sell_kind]);
|
|
61052
61229
|
if (remaining <= 0) {
|
|
61053
61230
|
break;
|
|
@@ -61348,7 +61525,8 @@ async function createLimitPurchaseOrders(client, symbol, priceFormat, quantityFo
|
|
|
61348
61525
|
const splitOrders = (inputOrders) => {
|
|
61349
61526
|
const result = [];
|
|
61350
61527
|
for (const o of inputOrders) {
|
|
61351
|
-
if (o.take_profit) {
|
|
61528
|
+
if (o.take_profit) {
|
|
61529
|
+
}
|
|
61352
61530
|
if (o.stop && !o.side) {
|
|
61353
61531
|
result.push({
|
|
61354
61532
|
price: o.price,
|
|
@@ -62275,7 +62453,8 @@ async function createLimitPurchaseOrders2(client, symbol, priceFormat, quantityF
|
|
|
62275
62453
|
const splitOrders = (inputOrders) => {
|
|
62276
62454
|
const result = [];
|
|
62277
62455
|
for (const o of inputOrders) {
|
|
62278
|
-
if (o.take_profit) {
|
|
62456
|
+
if (o.take_profit) {
|
|
62457
|
+
}
|
|
62279
62458
|
if (o.stop && !o.side) {
|
|
62280
62459
|
result.push({
|
|
62281
62460
|
price: o.price,
|
|
@@ -62876,9 +63055,12 @@ class BybitExchange extends BaseExchange {
|
|
|
62876
63055
|
sellLeverage: payload.leverage.toString()
|
|
62877
63056
|
});
|
|
62878
63057
|
}
|
|
62879
|
-
async generateConfig(payload) {
|
|
62880
|
-
|
|
62881
|
-
async
|
|
63058
|
+
async generateConfig(payload) {
|
|
63059
|
+
}
|
|
63060
|
+
async checkDelistedMovers(payload) {
|
|
63061
|
+
}
|
|
63062
|
+
async closePosition(payload) {
|
|
63063
|
+
}
|
|
62882
63064
|
async getAllOpenSymbols() {
|
|
62883
63065
|
return [];
|
|
62884
63066
|
}
|
|
@@ -62903,8 +63085,10 @@ class BybitExchange extends BaseExchange {
|
|
|
62903
63085
|
async getDelistedSpotSymbols() {
|
|
62904
63086
|
return [];
|
|
62905
63087
|
}
|
|
62906
|
-
async crossAccountTransfer(payload) {
|
|
62907
|
-
|
|
63088
|
+
async crossAccountTransfer(payload) {
|
|
63089
|
+
}
|
|
63090
|
+
async placeMarketOrder(payload) {
|
|
63091
|
+
}
|
|
62908
63092
|
async rawCreateLimitPurchaseOrders(payload) {
|
|
62909
63093
|
const { symbol, orders, price_places, decimal_places } = payload;
|
|
62910
63094
|
return createLimitPurchaseOrders2(this.client, symbol, price_places, decimal_places, orders);
|
|
@@ -62912,7 +63096,8 @@ class BybitExchange extends BaseExchange {
|
|
|
62912
63096
|
getOpenOrders(payload) {
|
|
62913
63097
|
return getOpenOrders2(this.client, payload.symbol);
|
|
62914
63098
|
}
|
|
62915
|
-
async placeBadStopEntry(payload) {
|
|
63099
|
+
async placeBadStopEntry(payload) {
|
|
63100
|
+
}
|
|
62916
63101
|
}
|
|
62917
63102
|
|
|
62918
63103
|
// src/helpers/accounts.ts
|
|
@@ -63866,7 +64051,8 @@ class ExchangeAccount {
|
|
|
63866
64051
|
cancelExchangeOrders: this.cancelExchangeOrders.bind(this)
|
|
63867
64052
|
});
|
|
63868
64053
|
}
|
|
63869
|
-
if (all) {
|
|
64054
|
+
if (all) {
|
|
64055
|
+
} else {
|
|
63870
64056
|
if (!price) {
|
|
63871
64057
|
const position2 = await this.syncAccount({
|
|
63872
64058
|
symbol,
|
|
@@ -65741,7 +65927,12 @@ class ExchangeAccount {
|
|
|
65741
65927
|
reward_factor = strategy.reward_factor;
|
|
65742
65928
|
}
|
|
65743
65929
|
if (focus_position.avg_qty >= focus_position.quantity && strategy.max_reward_factor) {
|
|
65744
|
-
|
|
65930
|
+
if (strategy.dynamic) {
|
|
65931
|
+
const quantity_ratio = focus_position.quantity / focus_position.avg_qty;
|
|
65932
|
+
reward_factor = to_f2(quantity_ratio ** 2 * strategy.max_reward_factor, "%.2f");
|
|
65933
|
+
} else {
|
|
65934
|
+
reward_factor = to_f2(focus_position.quantity * strategy.max_reward_factor / focus_position.avg_qty, "%.4f");
|
|
65935
|
+
}
|
|
65745
65936
|
} else {
|
|
65746
65937
|
reward_factor = strategy.reward_factor;
|
|
65747
65938
|
}
|
|
@@ -66534,7 +66725,8 @@ async function fetchExchangeDetails(payload) {
|
|
|
66534
66725
|
}
|
|
66535
66726
|
|
|
66536
66727
|
// src/mcp-server.ts
|
|
66537
|
-
console.log = (...args) => {
|
|
66728
|
+
console.log = (...args) => {
|
|
66729
|
+
};
|
|
66538
66730
|
var server = new McpServer({
|
|
66539
66731
|
name: "ultimate-trader",
|
|
66540
66732
|
version: "0.0.1",
|