@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.cjs
CHANGED
|
@@ -580,7 +580,8 @@ function cbcDecrypt(enc, cek, ciphertext, iv, tag, aad) {
|
|
|
580
580
|
let macCheckPassed;
|
|
581
581
|
try {
|
|
582
582
|
macCheckPassed = timing_safe_equal_default(tag, expectedTag);
|
|
583
|
-
} catch {
|
|
583
|
+
} catch {
|
|
584
|
+
}
|
|
584
585
|
if (!macCheckPassed) {
|
|
585
586
|
throw new JWEDecryptionFailed;
|
|
586
587
|
}
|
|
@@ -588,7 +589,8 @@ function cbcDecrypt(enc, cek, ciphertext, iv, tag, aad) {
|
|
|
588
589
|
try {
|
|
589
590
|
const decipher = import_node_crypto6.createDecipheriv(algorithm, encKey, iv);
|
|
590
591
|
plaintext = concat(decipher.update(ciphertext), decipher.final());
|
|
591
|
-
} catch {
|
|
592
|
+
} catch {
|
|
593
|
+
}
|
|
592
594
|
if (!plaintext) {
|
|
593
595
|
throw new JWEDecryptionFailed;
|
|
594
596
|
}
|
|
@@ -767,7 +769,8 @@ function isPublicJWK(key) {
|
|
|
767
769
|
function isSecretJWK(key) {
|
|
768
770
|
return isJWK(key) && key.kty === "oct" && typeof key.k === "string";
|
|
769
771
|
}
|
|
770
|
-
var init_is_jwk = () => {
|
|
772
|
+
var init_is_jwk = () => {
|
|
773
|
+
};
|
|
771
774
|
|
|
772
775
|
// node_modules/jose/dist/node/esm/runtime/get_named_curve.js
|
|
773
776
|
var import_node_crypto8, weakMap, namedCurveToJOSE = (namedCurve) => {
|
|
@@ -949,7 +952,8 @@ var import_node_crypto11, check_key_length_default = (key, alg) => {
|
|
|
949
952
|
} else {
|
|
950
953
|
modulusLength = Buffer.from(key.n, "base64url").byteLength << 3;
|
|
951
954
|
}
|
|
952
|
-
} catch {
|
|
955
|
+
} catch {
|
|
956
|
+
}
|
|
953
957
|
if (typeof modulusLength !== "number" || modulusLength < 2048) {
|
|
954
958
|
throw new TypeError(`${alg} requires key modulusLength to be 2048 bits or larger`);
|
|
955
959
|
}
|
|
@@ -1710,7 +1714,8 @@ async function generalDecrypt(jwe, key, options) {
|
|
|
1710
1714
|
tag: jwe.tag,
|
|
1711
1715
|
unprotected: jwe.unprotected
|
|
1712
1716
|
}, key, options);
|
|
1713
|
-
} catch {
|
|
1717
|
+
} catch {
|
|
1718
|
+
}
|
|
1714
1719
|
}
|
|
1715
1720
|
throw new JWEDecryptionFailed;
|
|
1716
1721
|
}
|
|
@@ -2596,7 +2601,8 @@ async function generalVerify(jws, key, options) {
|
|
|
2596
2601
|
protected: signature.protected,
|
|
2597
2602
|
signature: signature.signature
|
|
2598
2603
|
}, key, options);
|
|
2599
|
-
} catch {
|
|
2604
|
+
} catch {
|
|
2605
|
+
}
|
|
2600
2606
|
}
|
|
2601
2607
|
throw new JWSSignatureVerificationFailed;
|
|
2602
2608
|
}
|
|
@@ -2679,7 +2685,8 @@ var normalizeTyp = (value) => value.toLowerCase().replace(/^application\//, ""),
|
|
|
2679
2685
|
let payload;
|
|
2680
2686
|
try {
|
|
2681
2687
|
payload = JSON.parse(decoder.decode(encodedPayload));
|
|
2682
|
-
} catch {
|
|
2688
|
+
} catch {
|
|
2689
|
+
}
|
|
2683
2690
|
if (!isObject(payload)) {
|
|
2684
2691
|
throw new JWTInvalid("JWT Claims Set must be a top-level JSON object");
|
|
2685
2692
|
}
|
|
@@ -3364,7 +3371,8 @@ class LocalJWKSet {
|
|
|
3364
3371
|
for (const jwk2 of candidates) {
|
|
3365
3372
|
try {
|
|
3366
3373
|
yield await importWithAlgCache(_cached, jwk2, alg);
|
|
3367
|
-
} catch {
|
|
3374
|
+
} catch {
|
|
3375
|
+
}
|
|
3368
3376
|
}
|
|
3369
3377
|
};
|
|
3370
3378
|
throw error;
|
|
@@ -3911,7 +3919,8 @@ var require_util = __commonJS((exports2) => {
|
|
|
3911
3919
|
var util5;
|
|
3912
3920
|
(function(util6) {
|
|
3913
3921
|
util6.assertEqual = (val) => val;
|
|
3914
|
-
function assertIs(_arg) {
|
|
3922
|
+
function assertIs(_arg) {
|
|
3923
|
+
}
|
|
3915
3924
|
util6.assertIs = assertIs;
|
|
3916
3925
|
function assertNever(_x) {
|
|
3917
3926
|
throw new Error;
|
|
@@ -6327,7 +6336,8 @@ var require_types = __commonJS((exports2) => {
|
|
|
6327
6336
|
});
|
|
6328
6337
|
status.dirty();
|
|
6329
6338
|
}
|
|
6330
|
-
} else if (unknownKeys === "strip") {
|
|
6339
|
+
} else if (unknownKeys === "strip") {
|
|
6340
|
+
} else {
|
|
6331
6341
|
throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
|
|
6332
6342
|
}
|
|
6333
6343
|
} else {
|
|
@@ -8479,7 +8489,8 @@ var require_logLevelLogger = __commonJS((exports2) => {
|
|
|
8479
8489
|
if (typeof theFunc === "function" && maxLevel >= theLevel) {
|
|
8480
8490
|
return theFunc.bind(logger);
|
|
8481
8491
|
}
|
|
8482
|
-
return function() {
|
|
8492
|
+
return function() {
|
|
8493
|
+
};
|
|
8483
8494
|
}
|
|
8484
8495
|
return {
|
|
8485
8496
|
error: _filterFunc("error", types_1.DiagLogLevel.ERROR),
|
|
@@ -8704,7 +8715,8 @@ var require_NoopMeter = __commonJS((exports2) => {
|
|
|
8704
8715
|
exports2.createNoopMeter = exports2.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = exports2.NOOP_OBSERVABLE_GAUGE_METRIC = exports2.NOOP_OBSERVABLE_COUNTER_METRIC = exports2.NOOP_UP_DOWN_COUNTER_METRIC = exports2.NOOP_HISTOGRAM_METRIC = exports2.NOOP_GAUGE_METRIC = exports2.NOOP_COUNTER_METRIC = exports2.NOOP_METER = exports2.NoopObservableUpDownCounterMetric = exports2.NoopObservableGaugeMetric = exports2.NoopObservableCounterMetric = exports2.NoopObservableMetric = exports2.NoopHistogramMetric = exports2.NoopGaugeMetric = exports2.NoopUpDownCounterMetric = exports2.NoopCounterMetric = exports2.NoopMetric = exports2.NoopMeter = undefined;
|
|
8705
8716
|
|
|
8706
8717
|
class NoopMeter {
|
|
8707
|
-
constructor() {
|
|
8718
|
+
constructor() {
|
|
8719
|
+
}
|
|
8708
8720
|
createGauge(_name, _options) {
|
|
8709
8721
|
return exports2.NOOP_GAUGE_METRIC;
|
|
8710
8722
|
}
|
|
@@ -8726,8 +8738,10 @@ var require_NoopMeter = __commonJS((exports2) => {
|
|
|
8726
8738
|
createObservableUpDownCounter(_name, _options) {
|
|
8727
8739
|
return exports2.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC;
|
|
8728
8740
|
}
|
|
8729
|
-
addBatchObservableCallback(_callback, _observables) {
|
|
8730
|
-
|
|
8741
|
+
addBatchObservableCallback(_callback, _observables) {
|
|
8742
|
+
}
|
|
8743
|
+
removeBatchObservableCallback(_callback) {
|
|
8744
|
+
}
|
|
8731
8745
|
}
|
|
8732
8746
|
exports2.NoopMeter = NoopMeter;
|
|
8733
8747
|
|
|
@@ -8736,28 +8750,34 @@ var require_NoopMeter = __commonJS((exports2) => {
|
|
|
8736
8750
|
exports2.NoopMetric = NoopMetric;
|
|
8737
8751
|
|
|
8738
8752
|
class NoopCounterMetric extends NoopMetric {
|
|
8739
|
-
add(_value, _attributes) {
|
|
8753
|
+
add(_value, _attributes) {
|
|
8754
|
+
}
|
|
8740
8755
|
}
|
|
8741
8756
|
exports2.NoopCounterMetric = NoopCounterMetric;
|
|
8742
8757
|
|
|
8743
8758
|
class NoopUpDownCounterMetric extends NoopMetric {
|
|
8744
|
-
add(_value, _attributes) {
|
|
8759
|
+
add(_value, _attributes) {
|
|
8760
|
+
}
|
|
8745
8761
|
}
|
|
8746
8762
|
exports2.NoopUpDownCounterMetric = NoopUpDownCounterMetric;
|
|
8747
8763
|
|
|
8748
8764
|
class NoopGaugeMetric extends NoopMetric {
|
|
8749
|
-
record(_value, _attributes) {
|
|
8765
|
+
record(_value, _attributes) {
|
|
8766
|
+
}
|
|
8750
8767
|
}
|
|
8751
8768
|
exports2.NoopGaugeMetric = NoopGaugeMetric;
|
|
8752
8769
|
|
|
8753
8770
|
class NoopHistogramMetric extends NoopMetric {
|
|
8754
|
-
record(_value, _attributes) {
|
|
8771
|
+
record(_value, _attributes) {
|
|
8772
|
+
}
|
|
8755
8773
|
}
|
|
8756
8774
|
exports2.NoopHistogramMetric = NoopHistogramMetric;
|
|
8757
8775
|
|
|
8758
8776
|
class NoopObservableMetric {
|
|
8759
|
-
addCallback(_callback) {
|
|
8760
|
-
|
|
8777
|
+
addCallback(_callback) {
|
|
8778
|
+
}
|
|
8779
|
+
removeCallback(_callback) {
|
|
8780
|
+
}
|
|
8761
8781
|
}
|
|
8762
8782
|
exports2.NoopObservableMetric = NoopObservableMetric;
|
|
8763
8783
|
|
|
@@ -8862,7 +8882,8 @@ var require_context2 = __commonJS((exports2) => {
|
|
|
8862
8882
|
var NOOP_CONTEXT_MANAGER = new NoopContextManager_1.NoopContextManager;
|
|
8863
8883
|
|
|
8864
8884
|
class ContextAPI {
|
|
8865
|
-
constructor() {
|
|
8885
|
+
constructor() {
|
|
8886
|
+
}
|
|
8866
8887
|
static getInstance() {
|
|
8867
8888
|
if (!this._instance) {
|
|
8868
8889
|
this._instance = new ContextAPI;
|
|
@@ -8951,11 +8972,13 @@ var require_NonRecordingSpan = __commonJS((exports2) => {
|
|
|
8951
8972
|
updateName(_name) {
|
|
8952
8973
|
return this;
|
|
8953
8974
|
}
|
|
8954
|
-
end(_endTime) {
|
|
8975
|
+
end(_endTime) {
|
|
8976
|
+
}
|
|
8955
8977
|
isRecording() {
|
|
8956
8978
|
return false;
|
|
8957
8979
|
}
|
|
8958
|
-
recordException(_exception, _time) {
|
|
8980
|
+
recordException(_exception, _time) {
|
|
8981
|
+
}
|
|
8959
8982
|
}
|
|
8960
8983
|
exports2.NonRecordingSpan = NonRecordingSpan;
|
|
8961
8984
|
});
|
|
@@ -9257,7 +9280,8 @@ var require_tracestate_impl = __commonJS((exports2) => {
|
|
|
9257
9280
|
const value = listMember.slice(i + 1, part.length);
|
|
9258
9281
|
if ((0, tracestate_validators_1.validateKey)(key) && (0, tracestate_validators_1.validateValue)(value)) {
|
|
9259
9282
|
agg.set(key, value);
|
|
9260
|
-
} else {
|
|
9283
|
+
} else {
|
|
9284
|
+
}
|
|
9261
9285
|
}
|
|
9262
9286
|
return agg;
|
|
9263
9287
|
}, new Map);
|
|
@@ -9329,7 +9353,8 @@ var require_metrics = __commonJS((exports2) => {
|
|
|
9329
9353
|
var API_NAME2 = "metrics";
|
|
9330
9354
|
|
|
9331
9355
|
class MetricsAPI {
|
|
9332
|
-
constructor() {
|
|
9356
|
+
constructor() {
|
|
9357
|
+
}
|
|
9333
9358
|
static getInstance() {
|
|
9334
9359
|
if (!this._instance) {
|
|
9335
9360
|
this._instance = new MetricsAPI;
|
|
@@ -9366,7 +9391,8 @@ var require_NoopTextMapPropagator = __commonJS((exports2) => {
|
|
|
9366
9391
|
exports2.NoopTextMapPropagator = undefined;
|
|
9367
9392
|
|
|
9368
9393
|
class NoopTextMapPropagator {
|
|
9369
|
-
inject(_context, _carrier) {
|
|
9394
|
+
inject(_context, _carrier) {
|
|
9395
|
+
}
|
|
9370
9396
|
extract(context, _carrier) {
|
|
9371
9397
|
return context;
|
|
9372
9398
|
}
|
|
@@ -9679,7 +9705,8 @@ class Registry {
|
|
|
9679
9705
|
return this.kv.getByKey(identifier);
|
|
9680
9706
|
}
|
|
9681
9707
|
}
|
|
9682
|
-
var init_registry = () => {
|
|
9708
|
+
var init_registry = () => {
|
|
9709
|
+
};
|
|
9683
9710
|
|
|
9684
9711
|
// node_modules/superjson/dist/class-registry.js
|
|
9685
9712
|
var ClassRegistry;
|
|
@@ -9764,7 +9791,8 @@ class CustomTransformerRegistry {
|
|
|
9764
9791
|
return this.transfomers[name2];
|
|
9765
9792
|
}
|
|
9766
9793
|
}
|
|
9767
|
-
var init_custom_transformer_registry = () => {
|
|
9794
|
+
var init_custom_transformer_registry = () => {
|
|
9795
|
+
};
|
|
9768
9796
|
|
|
9769
9797
|
// node_modules/superjson/dist/is.js
|
|
9770
9798
|
var getType = (payload) => Object.prototype.toString.call(payload).slice(8, -1), isUndefined = (payload) => typeof payload === "undefined", isNull = (payload) => payload === null, isPlainObject = (payload) => {
|
|
@@ -10109,7 +10137,8 @@ var getNthKey = (value, n) => {
|
|
|
10109
10137
|
}
|
|
10110
10138
|
return object2;
|
|
10111
10139
|
};
|
|
10112
|
-
var init_accessDeep = () => {
|
|
10140
|
+
var init_accessDeep = () => {
|
|
10141
|
+
};
|
|
10113
10142
|
|
|
10114
10143
|
// node_modules/superjson/dist/plainer.js
|
|
10115
10144
|
function traverse(tree, walker, origin = []) {
|
|
@@ -10698,7 +10727,8 @@ var require_NoopLogger = __commonJS((exports2) => {
|
|
|
10698
10727
|
exports2.NOOP_LOGGER = exports2.NoopLogger = undefined;
|
|
10699
10728
|
|
|
10700
10729
|
class NoopLogger {
|
|
10701
|
-
emit(_logRecord) {
|
|
10730
|
+
emit(_logRecord) {
|
|
10731
|
+
}
|
|
10702
10732
|
}
|
|
10703
10733
|
exports2.NoopLogger = NoopLogger;
|
|
10704
10734
|
exports2.NOOP_LOGGER = new NoopLogger;
|
|
@@ -10792,7 +10822,8 @@ var require_logs = __commonJS((exports2) => {
|
|
|
10792
10822
|
var NoopLoggerProvider_1 = require_NoopLoggerProvider();
|
|
10793
10823
|
|
|
10794
10824
|
class LogsAPI {
|
|
10795
|
-
constructor() {
|
|
10825
|
+
constructor() {
|
|
10826
|
+
}
|
|
10796
10827
|
static getInstance() {
|
|
10797
10828
|
if (!this._instance) {
|
|
10798
10829
|
this._instance = new LogsAPI;
|
|
@@ -11260,7 +11291,8 @@ var require_browser = __commonJS((exports2, module2) => {
|
|
|
11260
11291
|
});
|
|
11261
11292
|
args.splice(lastC, 0, c);
|
|
11262
11293
|
}
|
|
11263
|
-
exports2.log = console.debug || console.log || (() => {
|
|
11294
|
+
exports2.log = console.debug || console.log || (() => {
|
|
11295
|
+
});
|
|
11264
11296
|
function save(namespaces) {
|
|
11265
11297
|
try {
|
|
11266
11298
|
if (namespaces) {
|
|
@@ -11268,13 +11300,15 @@ var require_browser = __commonJS((exports2, module2) => {
|
|
|
11268
11300
|
} else {
|
|
11269
11301
|
exports2.storage.removeItem("debug");
|
|
11270
11302
|
}
|
|
11271
|
-
} catch (error) {
|
|
11303
|
+
} catch (error) {
|
|
11304
|
+
}
|
|
11272
11305
|
}
|
|
11273
11306
|
function load() {
|
|
11274
11307
|
let r;
|
|
11275
11308
|
try {
|
|
11276
11309
|
r = exports2.storage.getItem("debug");
|
|
11277
|
-
} catch (error) {
|
|
11310
|
+
} catch (error) {
|
|
11311
|
+
}
|
|
11278
11312
|
if (!r && typeof process !== "undefined" && "env" in process) {
|
|
11279
11313
|
r = process.env.DEBUG;
|
|
11280
11314
|
}
|
|
@@ -11283,7 +11317,8 @@ var require_browser = __commonJS((exports2, module2) => {
|
|
|
11283
11317
|
function localstorage() {
|
|
11284
11318
|
try {
|
|
11285
11319
|
return localStorage;
|
|
11286
|
-
} catch (error) {
|
|
11320
|
+
} catch (error) {
|
|
11321
|
+
}
|
|
11287
11322
|
}
|
|
11288
11323
|
module2.exports = require_common()(exports2);
|
|
11289
11324
|
var { formatters } = module2.exports;
|
|
@@ -11415,7 +11450,8 @@ var require_node3 = __commonJS((exports2, module2) => {
|
|
|
11415
11450
|
exports2.save = save;
|
|
11416
11451
|
exports2.load = load;
|
|
11417
11452
|
exports2.useColors = useColors;
|
|
11418
|
-
exports2.destroy = util5.deprecate(() => {
|
|
11453
|
+
exports2.destroy = util5.deprecate(() => {
|
|
11454
|
+
}, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
11419
11455
|
exports2.colors = [6, 2, 3, 4, 5, 1];
|
|
11420
11456
|
try {
|
|
11421
11457
|
const supportsColor = require_supports_color();
|
|
@@ -11499,7 +11535,8 @@ var require_node3 = __commonJS((exports2, module2) => {
|
|
|
11499
11535
|
221
|
|
11500
11536
|
];
|
|
11501
11537
|
}
|
|
11502
|
-
} catch (error) {
|
|
11538
|
+
} catch (error) {
|
|
11539
|
+
}
|
|
11503
11540
|
exports2.inspectOpts = Object.keys(process.env).filter((key) => {
|
|
11504
11541
|
return /^debug_/i.test(key);
|
|
11505
11542
|
}).reduce((obj, key) => {
|
|
@@ -13748,7 +13785,8 @@ var require_jsbn = __commonJS((exports2, module2) => {
|
|
|
13748
13785
|
++this[w];
|
|
13749
13786
|
}
|
|
13750
13787
|
}
|
|
13751
|
-
function NullExp() {
|
|
13788
|
+
function NullExp() {
|
|
13789
|
+
}
|
|
13752
13790
|
function nNop(x) {
|
|
13753
13791
|
return x;
|
|
13754
13792
|
}
|
|
@@ -14173,7 +14211,8 @@ var require_jsbn = __commonJS((exports2, module2) => {
|
|
|
14173
14211
|
for (i2 = 0;i2 < ba.length; ++i2)
|
|
14174
14212
|
ba[i2] = rng_get_byte();
|
|
14175
14213
|
}
|
|
14176
|
-
function SecureRandom() {
|
|
14214
|
+
function SecureRandom() {
|
|
14215
|
+
}
|
|
14177
14216
|
SecureRandom.prototype.nextBytes = rng_get_bytes;
|
|
14178
14217
|
function Arcfour() {
|
|
14179
14218
|
this.i = 0;
|
|
@@ -16396,7 +16435,8 @@ var require_delayed_stream = __commonJS((exports2, module2) => {
|
|
|
16396
16435
|
delayedStream._handleEmit(arguments);
|
|
16397
16436
|
return realEmit.apply(source, arguments);
|
|
16398
16437
|
};
|
|
16399
|
-
source.on("error", function() {
|
|
16438
|
+
source.on("error", function() {
|
|
16439
|
+
});
|
|
16400
16440
|
if (delayedStream.pauseStream) {
|
|
16401
16441
|
source.pause();
|
|
16402
16442
|
}
|
|
@@ -25700,7 +25740,8 @@ var require_implementation = __commonJS((exports2, module2) => {
|
|
|
25700
25740
|
}
|
|
25701
25741
|
bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
|
|
25702
25742
|
if (target.prototype) {
|
|
25703
|
-
var Empty = function Empty() {
|
|
25743
|
+
var Empty = function Empty() {
|
|
25744
|
+
};
|
|
25704
25745
|
Empty.prototype = target.prototype;
|
|
25705
25746
|
bound.prototype = new Empty;
|
|
25706
25747
|
Empty.prototype = null;
|
|
@@ -25820,7 +25861,8 @@ var require_get_intrinsic = __commonJS((exports2, module2) => {
|
|
|
25820
25861
|
var getEvalledConstructor = function(expressionSyntax) {
|
|
25821
25862
|
try {
|
|
25822
25863
|
return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")();
|
|
25823
|
-
} catch (e2) {
|
|
25864
|
+
} catch (e2) {
|
|
25865
|
+
}
|
|
25824
25866
|
};
|
|
25825
25867
|
var $gOPD = require_gopd();
|
|
25826
25868
|
var $defineProperty = require_es_define_property();
|
|
@@ -26559,9 +26601,11 @@ var require_debug = __commonJS((exports2, module2) => {
|
|
|
26559
26601
|
if (!debug) {
|
|
26560
26602
|
try {
|
|
26561
26603
|
debug = require_src4()("follow-redirects");
|
|
26562
|
-
} catch (error) {
|
|
26604
|
+
} catch (error) {
|
|
26605
|
+
}
|
|
26563
26606
|
if (typeof debug !== "function") {
|
|
26564
|
-
debug = function() {
|
|
26607
|
+
debug = function() {
|
|
26608
|
+
};
|
|
26565
26609
|
}
|
|
26566
26610
|
}
|
|
26567
26611
|
debug.apply(null, arguments);
|
|
@@ -26936,7 +26980,8 @@ var require_follow_redirects = __commonJS((exports2, module2) => {
|
|
|
26936
26980
|
});
|
|
26937
26981
|
return exports3;
|
|
26938
26982
|
}
|
|
26939
|
-
function noop2() {
|
|
26983
|
+
function noop2() {
|
|
26984
|
+
}
|
|
26940
26985
|
function parseUrl(input) {
|
|
26941
26986
|
var parsed;
|
|
26942
26987
|
if (useNativeURL) {
|
|
@@ -27319,7 +27364,8 @@ var require_axios = __commonJS((exports2, module2) => {
|
|
|
27319
27364
|
isArray3(arrayOrString) ? define2(arrayOrString) : define2(String(arrayOrString).split(delimiter));
|
|
27320
27365
|
return obj;
|
|
27321
27366
|
};
|
|
27322
|
-
var noop2 = () => {
|
|
27367
|
+
var noop2 = () => {
|
|
27368
|
+
};
|
|
27323
27369
|
var toFiniteNumber = (value2, defaultValue) => {
|
|
27324
27370
|
return value2 != null && Number.isFinite(value2 = +value2) ? value2 : defaultValue;
|
|
27325
27371
|
};
|
|
@@ -28772,7 +28818,8 @@ var require_axios = __commonJS((exports2, module2) => {
|
|
|
28772
28818
|
try {
|
|
28773
28819
|
const knownLength = await util__default["default"].promisify(data.getLength).call(data);
|
|
28774
28820
|
Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);
|
|
28775
|
-
} catch (e2) {
|
|
28821
|
+
} catch (e2) {
|
|
28822
|
+
}
|
|
28776
28823
|
}
|
|
28777
28824
|
} else if (utils$1.isBlob(data) || utils$1.isFile(data)) {
|
|
28778
28825
|
data.size && headers.setContentType(data.type || "application/octet-stream");
|
|
@@ -29046,11 +29093,13 @@ var require_axios = __commonJS((exports2, module2) => {
|
|
|
29046
29093
|
this.write(name2, "", Date.now() - 86400000);
|
|
29047
29094
|
}
|
|
29048
29095
|
} : {
|
|
29049
|
-
write() {
|
|
29096
|
+
write() {
|
|
29097
|
+
},
|
|
29050
29098
|
read() {
|
|
29051
29099
|
return null;
|
|
29052
29100
|
},
|
|
29053
|
-
remove() {
|
|
29101
|
+
remove() {
|
|
29102
|
+
}
|
|
29054
29103
|
};
|
|
29055
29104
|
var headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
|
|
29056
29105
|
function mergeConfig(config1, config2) {
|
|
@@ -29544,7 +29593,8 @@ var require_axios = __commonJS((exports2, module2) => {
|
|
|
29544
29593
|
if (fn) {
|
|
29545
29594
|
try {
|
|
29546
29595
|
Object.defineProperty(fn, "name", { value: value2 });
|
|
29547
|
-
} catch (e2) {
|
|
29596
|
+
} catch (e2) {
|
|
29597
|
+
}
|
|
29548
29598
|
Object.defineProperty(fn, "adapterName", { value: value2 });
|
|
29549
29599
|
}
|
|
29550
29600
|
});
|
|
@@ -29694,7 +29744,8 @@ var require_axios = __commonJS((exports2, module2) => {
|
|
|
29694
29744
|
err.stack += `
|
|
29695
29745
|
` + stack;
|
|
29696
29746
|
}
|
|
29697
|
-
} catch (e2) {
|
|
29747
|
+
} catch (e2) {
|
|
29748
|
+
}
|
|
29698
29749
|
}
|
|
29699
29750
|
throw err;
|
|
29700
29751
|
}
|
|
@@ -31767,7 +31818,8 @@ var require_logger = __commonJS((exports2) => {
|
|
|
31767
31818
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
31768
31819
|
exports2.DefaultLogger = undefined;
|
|
31769
31820
|
exports2.DefaultLogger = {
|
|
31770
|
-
silly: (...params) => {
|
|
31821
|
+
silly: (...params) => {
|
|
31822
|
+
},
|
|
31771
31823
|
debug: (...params) => {
|
|
31772
31824
|
console.log(new Date, params);
|
|
31773
31825
|
},
|
|
@@ -34510,7 +34562,8 @@ var require_constants4 = __commonJS((exports2, module2) => {
|
|
|
34510
34562
|
kListener: Symbol("kListener"),
|
|
34511
34563
|
kStatusCode: Symbol("status-code"),
|
|
34512
34564
|
kWebSocket: Symbol("websocket"),
|
|
34513
|
-
NOOP: () => {
|
|
34565
|
+
NOOP: () => {
|
|
34566
|
+
}
|
|
34514
34567
|
};
|
|
34515
34568
|
});
|
|
34516
34569
|
|
|
@@ -34588,7 +34641,8 @@ var require_buffer_util = __commonJS((exports2, module2) => {
|
|
|
34588
34641
|
else
|
|
34589
34642
|
bufferUtil.unmask(buffer, mask);
|
|
34590
34643
|
};
|
|
34591
|
-
} catch (e2) {
|
|
34644
|
+
} catch (e2) {
|
|
34645
|
+
}
|
|
34592
34646
|
}
|
|
34593
34647
|
});
|
|
34594
34648
|
|
|
@@ -35067,7 +35121,8 @@ var require_validation = __commonJS((exports2, module2) => {
|
|
|
35067
35121
|
module2.exports.isValidUTF8 = function(buf) {
|
|
35068
35122
|
return buf.length < 32 ? _isValidUTF8(buf) : isValidUTF8(buf);
|
|
35069
35123
|
};
|
|
35070
|
-
} catch (e2) {
|
|
35124
|
+
} catch (e2) {
|
|
35125
|
+
}
|
|
35071
35126
|
}
|
|
35072
35127
|
});
|
|
35073
35128
|
|
|
@@ -37497,7 +37552,8 @@ var require_websocket_client = __commonJS((exports2) => {
|
|
|
37497
37552
|
this.options = Object.assign({ pongTimeout: 7500, pingInterval: 1e4, reconnectTimeout: 500 }, options);
|
|
37498
37553
|
this.listenKeyStateStore = {};
|
|
37499
37554
|
this.wsUrlKeyMap = {};
|
|
37500
|
-
this.on("error", () => {
|
|
37555
|
+
this.on("error", () => {
|
|
37556
|
+
});
|
|
37501
37557
|
}
|
|
37502
37558
|
getRestClientOptions() {
|
|
37503
37559
|
return Object.assign(Object.assign(Object.assign({}, this.options), this.options.restOptions), { api_key: this.options.api_key, api_secret: this.options.api_secret });
|
|
@@ -38914,7 +38970,8 @@ var require_logger2 = __commonJS((exports2) => {
|
|
|
38914
38970
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
38915
38971
|
exports2.DefaultLogger = undefined;
|
|
38916
38972
|
exports2.DefaultLogger = {
|
|
38917
|
-
trace: (..._params) => {
|
|
38973
|
+
trace: (..._params) => {
|
|
38974
|
+
},
|
|
38918
38975
|
info: (...params) => {
|
|
38919
38976
|
console.info(params);
|
|
38920
38977
|
},
|
|
@@ -40960,7 +41017,8 @@ var require_BaseWSClient = __commonJS((exports2) => {
|
|
|
40960
41017
|
if (wsState === null || wsState === undefined ? undefined : wsState.activePongTimer) {
|
|
40961
41018
|
clearTimeout(wsState.activePongTimer);
|
|
40962
41019
|
wsState.activePongTimer = undefined;
|
|
40963
|
-
} else {
|
|
41020
|
+
} else {
|
|
41021
|
+
}
|
|
40964
41022
|
}
|
|
40965
41023
|
clearReconnectTimer(wsKey) {
|
|
40966
41024
|
const wsState = this.wsStore.get(wsKey);
|
|
@@ -41838,7 +41896,8 @@ module.exports = __toCommonJS(exports_mcp_server);
|
|
|
41838
41896
|
var util;
|
|
41839
41897
|
(function(util2) {
|
|
41840
41898
|
util2.assertEqual = (val) => val;
|
|
41841
|
-
function assertIs(_arg) {
|
|
41899
|
+
function assertIs(_arg) {
|
|
41900
|
+
}
|
|
41842
41901
|
util2.assertIs = assertIs;
|
|
41843
41902
|
function assertNever(_x) {
|
|
41844
41903
|
throw new Error;
|
|
@@ -47193,7 +47252,8 @@ function parseStringDef(def, refs) {
|
|
|
47193
47252
|
case "trim":
|
|
47194
47253
|
break;
|
|
47195
47254
|
default:
|
|
47196
|
-
((_) => {
|
|
47255
|
+
((_) => {
|
|
47256
|
+
})(check);
|
|
47197
47257
|
}
|
|
47198
47258
|
}
|
|
47199
47259
|
}
|
|
@@ -48583,7 +48643,8 @@ class StdioServerTransport {
|
|
|
48583
48643
|
var util2;
|
|
48584
48644
|
(function(util3) {
|
|
48585
48645
|
util3.assertEqual = (val) => val;
|
|
48586
|
-
function assertIs(_arg) {
|
|
48646
|
+
function assertIs(_arg) {
|
|
48647
|
+
}
|
|
48587
48648
|
util3.assertIs = assertIs;
|
|
48588
48649
|
function assertNever(_x) {
|
|
48589
48650
|
throw new Error;
|
|
@@ -53444,7 +53505,8 @@ var API_NAME = "task-context";
|
|
|
53444
53505
|
|
|
53445
53506
|
class TaskContextAPI {
|
|
53446
53507
|
static _instance;
|
|
53447
|
-
constructor() {
|
|
53508
|
+
constructor() {
|
|
53509
|
+
}
|
|
53448
53510
|
static getInstance() {
|
|
53449
53511
|
if (!this._instance) {
|
|
53450
53512
|
this._instance = new TaskContextAPI;
|
|
@@ -53864,7 +53926,8 @@ class ParseError extends Error {
|
|
|
53864
53926
|
super(message2), this.name = "ParseError", this.type = options.type, this.field = options.field, this.value = options.value, this.line = options.line;
|
|
53865
53927
|
}
|
|
53866
53928
|
}
|
|
53867
|
-
function noop(_arg) {
|
|
53929
|
+
function noop(_arg) {
|
|
53930
|
+
}
|
|
53868
53931
|
function createParser(callbacks) {
|
|
53869
53932
|
if (typeof callbacks == "function")
|
|
53870
53933
|
throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");
|
|
@@ -54067,7 +54130,8 @@ async function _doZodFetchWithRetries(schema, url, requestInit, options, attempt
|
|
|
54067
54130
|
if (error instanceof ApiError) {
|
|
54068
54131
|
throw error;
|
|
54069
54132
|
}
|
|
54070
|
-
if (error instanceof import_zod_validation_error.ValidationError) {
|
|
54133
|
+
if (error instanceof import_zod_validation_error.ValidationError) {
|
|
54134
|
+
}
|
|
54071
54135
|
if (options?.retry) {
|
|
54072
54136
|
const retry = { ...defaultRetryOptions2, ...options.retry };
|
|
54073
54137
|
const delay = calculateNextRetryDelay(retry, attempt);
|
|
@@ -54541,7 +54605,8 @@ class ApiClientMissingError extends Error {
|
|
|
54541
54605
|
|
|
54542
54606
|
class APIClientManagerAPI {
|
|
54543
54607
|
static _instance;
|
|
54544
|
-
constructor() {
|
|
54608
|
+
constructor() {
|
|
54609
|
+
}
|
|
54545
54610
|
static getInstance() {
|
|
54546
54611
|
if (!this._instance) {
|
|
54547
54612
|
this._instance = new APIClientManagerAPI;
|
|
@@ -55096,7 +55161,8 @@ var PrefetchQueue = class {
|
|
|
55096
55161
|
if (__privateGet(this, _queueTailUrl) && !__privateGet(this, _prefetchQueue).has(__privateGet(this, _queueTailUrl))) {
|
|
55097
55162
|
__privateMethod(this, _PrefetchQueue_instances, prefetch_fn).call(this, __privateGet(this, _queueTailUrl), args[1]);
|
|
55098
55163
|
}
|
|
55099
|
-
}).catch(() => {
|
|
55164
|
+
}).catch(() => {
|
|
55165
|
+
});
|
|
55100
55166
|
return request;
|
|
55101
55167
|
}
|
|
55102
55168
|
};
|
|
@@ -55127,8 +55193,10 @@ prefetch_fn = function(...args) {
|
|
|
55127
55193
|
}
|
|
55128
55194
|
__privateSet(this, _queueTailUrl, nextUrl);
|
|
55129
55195
|
return __privateMethod(this, _PrefetchQueue_instances, prefetch_fn).call(this, nextUrl, args[1]);
|
|
55130
|
-
}).catch(() => {
|
|
55131
|
-
|
|
55196
|
+
}).catch(() => {
|
|
55197
|
+
});
|
|
55198
|
+
} catch (_) {
|
|
55199
|
+
}
|
|
55132
55200
|
};
|
|
55133
55201
|
function getNextChunkUrl(url, res) {
|
|
55134
55202
|
const shapeHandle = res.headers.get(SHAPE_HANDLE_HEADER);
|
|
@@ -55231,7 +55299,8 @@ var ShapeStream = class {
|
|
|
55231
55299
|
get lastOffset() {
|
|
55232
55300
|
return __privateGet(this, _lastOffset);
|
|
55233
55301
|
}
|
|
55234
|
-
subscribe(callback, onError = () => {
|
|
55302
|
+
subscribe(callback, onError = () => {
|
|
55303
|
+
}) {
|
|
55235
55304
|
const subscriptionId = Math.random();
|
|
55236
55305
|
__privateGet(this, _subscribers).set(subscriptionId, [callback, onError]);
|
|
55237
55306
|
return () => {
|
|
@@ -56425,7 +56494,8 @@ class SimpleClock {
|
|
|
56425
56494
|
const nowStruct = now.toStruct();
|
|
56426
56495
|
return [nowStruct.seconds, nowStruct.nanos];
|
|
56427
56496
|
}
|
|
56428
|
-
reset() {
|
|
56497
|
+
reset() {
|
|
56498
|
+
}
|
|
56429
56499
|
}
|
|
56430
56500
|
|
|
56431
56501
|
// node_modules/@trigger.dev/core/dist/esm/v3/clock/index.js
|
|
@@ -56434,7 +56504,8 @@ var SIMPLE_CLOCK = new SimpleClock;
|
|
|
56434
56504
|
|
|
56435
56505
|
class ClockAPI {
|
|
56436
56506
|
static _instance;
|
|
56437
|
-
constructor() {
|
|
56507
|
+
constructor() {
|
|
56508
|
+
}
|
|
56438
56509
|
static getInstance() {
|
|
56439
56510
|
if (!this._instance) {
|
|
56440
56511
|
this._instance = new ClockAPI;
|
|
@@ -56460,7 +56531,8 @@ var clock = ClockAPI.getInstance();
|
|
|
56460
56531
|
|
|
56461
56532
|
// node_modules/@trigger.dev/core/dist/esm/v3/usage/noopUsageManager.js
|
|
56462
56533
|
class NoopUsageManager {
|
|
56463
|
-
disable() {
|
|
56534
|
+
disable() {
|
|
56535
|
+
}
|
|
56464
56536
|
start() {
|
|
56465
56537
|
return {
|
|
56466
56538
|
sample: () => ({ cpuTime: 0, wallTime: 0 })
|
|
@@ -56483,7 +56555,8 @@ var NOOP_USAGE_MANAGER = new NoopUsageManager;
|
|
|
56483
56555
|
|
|
56484
56556
|
class UsageAPI {
|
|
56485
56557
|
static _instance;
|
|
56486
|
-
constructor() {
|
|
56558
|
+
constructor() {
|
|
56559
|
+
}
|
|
56487
56560
|
static getInstance() {
|
|
56488
56561
|
if (!this._instance) {
|
|
56489
56562
|
this._instance = new UsageAPI;
|
|
@@ -56543,7 +56616,8 @@ class NoopRunMetadataManager {
|
|
|
56543
56616
|
refresh(requestOptions) {
|
|
56544
56617
|
throw new Error("Method not implemented.");
|
|
56545
56618
|
}
|
|
56546
|
-
enterWithMetadata(metadata) {
|
|
56619
|
+
enterWithMetadata(metadata) {
|
|
56620
|
+
}
|
|
56547
56621
|
current() {
|
|
56548
56622
|
throw new Error("Method not implemented.");
|
|
56549
56623
|
}
|
|
@@ -56599,7 +56673,8 @@ var NOOP_MANAGER = new NoopRunMetadataManager;
|
|
|
56599
56673
|
|
|
56600
56674
|
class RunMetadataAPI {
|
|
56601
56675
|
static _instance;
|
|
56602
|
-
constructor() {
|
|
56676
|
+
constructor() {
|
|
56677
|
+
}
|
|
56603
56678
|
static getInstance() {
|
|
56604
56679
|
if (!this._instance) {
|
|
56605
56680
|
this._instance = new RunMetadataAPI;
|
|
@@ -56684,7 +56759,8 @@ var NOOP_TIMEOUT_MANAGER = new NoopTimeoutManager;
|
|
|
56684
56759
|
|
|
56685
56760
|
class TimeoutAPI {
|
|
56686
56761
|
static _instance;
|
|
56687
|
-
constructor() {
|
|
56762
|
+
constructor() {
|
|
56763
|
+
}
|
|
56688
56764
|
static getInstance() {
|
|
56689
56765
|
if (!this._instance) {
|
|
56690
56766
|
this._instance = new TimeoutAPI;
|
|
@@ -57083,7 +57159,8 @@ function getTokenPayload(e2) {
|
|
|
57083
57159
|
return "%" + ("00" + e3.charCodeAt(0).toString(16)).slice(-2);
|
|
57084
57160
|
}).join(""));
|
|
57085
57161
|
return JSON.parse(t2) || {};
|
|
57086
|
-
} catch (e3) {
|
|
57162
|
+
} catch (e3) {
|
|
57163
|
+
}
|
|
57087
57164
|
return {};
|
|
57088
57165
|
}
|
|
57089
57166
|
function isTokenExpired(e2, t2 = 0) {
|
|
@@ -57137,7 +57214,8 @@ class BaseAuthStore {
|
|
|
57137
57214
|
let n = {};
|
|
57138
57215
|
try {
|
|
57139
57216
|
n = JSON.parse(s2), (typeof n === null || typeof n != "object" || Array.isArray(n)) && (n = {});
|
|
57140
|
-
} catch (e3) {
|
|
57217
|
+
} catch (e3) {
|
|
57218
|
+
}
|
|
57141
57219
|
this.save(n.token || "", n.record || n.model || null);
|
|
57142
57220
|
}
|
|
57143
57221
|
exportToCookie(e2, t2 = i) {
|
|
@@ -57284,7 +57362,8 @@ class RealtimeService extends BaseService {
|
|
|
57284
57362
|
let i3;
|
|
57285
57363
|
try {
|
|
57286
57364
|
i3 = JSON.parse(s3?.data);
|
|
57287
|
-
} catch {
|
|
57365
|
+
} catch {
|
|
57366
|
+
}
|
|
57288
57367
|
t2(i3 || {});
|
|
57289
57368
|
};
|
|
57290
57369
|
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);
|
|
@@ -57997,7 +58076,8 @@ class Client {
|
|
|
57997
58076
|
let s3 = {};
|
|
57998
58077
|
try {
|
|
57999
58078
|
s3 = await e3.json();
|
|
58000
|
-
} catch (e4) {
|
|
58079
|
+
} catch (e4) {
|
|
58080
|
+
}
|
|
58001
58081
|
if (this.afterSend && (s3 = await this.afterSend(e3, s3, t2)), e3.status >= 400)
|
|
58002
58082
|
throw new ClientResponseError({ url: e3.url, status: e3.status, data: s3 });
|
|
58003
58083
|
return s3;
|
|
@@ -58629,6 +58709,91 @@ class AppDatabase {
|
|
|
58629
58709
|
}
|
|
58630
58710
|
return null;
|
|
58631
58711
|
}
|
|
58712
|
+
async getBotViewInstance(payload) {
|
|
58713
|
+
const { asset, main_account } = payload;
|
|
58714
|
+
const bot_instances = await this.pb.collection("bot_view").getFullList({
|
|
58715
|
+
filter: `main_symbol:lower="${asset.toLowerCase()}" && main_account.owner:lower="${main_account.owner.toLowerCase()}" && main_account.exchange:lower="${main_account.exchange.toLowerCase()}"`,
|
|
58716
|
+
expand: "main_account,secondary_account,main_long_strategy,main_short_strategy,secondary_long_strategy,secondary_short_strategy"
|
|
58717
|
+
});
|
|
58718
|
+
if (bot_instances.length > 0) {
|
|
58719
|
+
const instance = bot_instances[0];
|
|
58720
|
+
const {
|
|
58721
|
+
main_account: main_account2,
|
|
58722
|
+
secondary_account,
|
|
58723
|
+
main_long_strategy,
|
|
58724
|
+
main_short_strategy,
|
|
58725
|
+
secondary_long_strategy,
|
|
58726
|
+
secondary_short_strategy
|
|
58727
|
+
} = instance.expand;
|
|
58728
|
+
return {
|
|
58729
|
+
...instance,
|
|
58730
|
+
main: {
|
|
58731
|
+
account: main_account2,
|
|
58732
|
+
symbol: instance.main_symbol,
|
|
58733
|
+
strategy: {
|
|
58734
|
+
long: main_long_strategy,
|
|
58735
|
+
short: main_short_strategy
|
|
58736
|
+
},
|
|
58737
|
+
position: {
|
|
58738
|
+
long: instance.main_long_position,
|
|
58739
|
+
short: instance.main_short_position
|
|
58740
|
+
}
|
|
58741
|
+
},
|
|
58742
|
+
secondary: {
|
|
58743
|
+
account: secondary_account,
|
|
58744
|
+
symbol: instance.secondary_symbol,
|
|
58745
|
+
strategy: {
|
|
58746
|
+
long: secondary_long_strategy,
|
|
58747
|
+
short: secondary_short_strategy
|
|
58748
|
+
},
|
|
58749
|
+
position: {
|
|
58750
|
+
long: instance.secondary_long_position,
|
|
58751
|
+
short: instance.secondary_short_position
|
|
58752
|
+
}
|
|
58753
|
+
}
|
|
58754
|
+
};
|
|
58755
|
+
}
|
|
58756
|
+
return null;
|
|
58757
|
+
}
|
|
58758
|
+
async getBotInstance(payload) {
|
|
58759
|
+
const { asset, main_account } = payload;
|
|
58760
|
+
const bot_instances = await this.pb.collection("bot_instances").getFullList({
|
|
58761
|
+
filter: `asset:lower="${asset.toLowerCase()}" && main_account.owner:lower="${main_account.owner.toLowerCase()}" && main_account.exchange:lower="${main_account.exchange.toLowerCase()}"`
|
|
58762
|
+
});
|
|
58763
|
+
if (bot_instances.length > 0) {
|
|
58764
|
+
return bot_instances[0];
|
|
58765
|
+
}
|
|
58766
|
+
return null;
|
|
58767
|
+
}
|
|
58768
|
+
async getBotState(payload) {
|
|
58769
|
+
const { asset, main_account, running } = payload;
|
|
58770
|
+
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()}"`;
|
|
58771
|
+
if (running !== undefined) {
|
|
58772
|
+
filter += ` && running=${running}`;
|
|
58773
|
+
}
|
|
58774
|
+
const bot_states = await this.pb.collection("bot_states").getFullList({
|
|
58775
|
+
filter
|
|
58776
|
+
});
|
|
58777
|
+
return bot_states;
|
|
58778
|
+
}
|
|
58779
|
+
async getBotOrderHistories(payload) {
|
|
58780
|
+
const { asset, main_account, symbol, kind, type } = payload;
|
|
58781
|
+
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()}"`;
|
|
58782
|
+
if (symbol) {
|
|
58783
|
+
filter += ` && symbol:lower="${symbol.toLowerCase()}"`;
|
|
58784
|
+
}
|
|
58785
|
+
if (kind) {
|
|
58786
|
+
filter += ` && kind="${kind}"`;
|
|
58787
|
+
}
|
|
58788
|
+
if (type) {
|
|
58789
|
+
filter += ` && type="${type}"`;
|
|
58790
|
+
}
|
|
58791
|
+
const bot_order_histories = await this.pb.collection("bot_order_history").getFullList({
|
|
58792
|
+
filter,
|
|
58793
|
+
sort: "-created"
|
|
58794
|
+
});
|
|
58795
|
+
return bot_order_histories;
|
|
58796
|
+
}
|
|
58632
58797
|
async createOrUpdateWindingDownMarket(payload) {
|
|
58633
58798
|
const { symbol, risk_reward = 30 } = payload;
|
|
58634
58799
|
const existing_winding_down_market = await this.pb.collection("winding_down_markets").getFullList({
|
|
@@ -59294,7 +59459,8 @@ class Signal {
|
|
|
59294
59459
|
support: kind === "long" ? _stop_loss : this.support
|
|
59295
59460
|
};
|
|
59296
59461
|
const instance = new Signal(derivedConfig);
|
|
59297
|
-
if (kind === "short") {
|
|
59462
|
+
if (kind === "short") {
|
|
59463
|
+
}
|
|
59298
59464
|
let result = instance.get_bulk_trade_zones({ current_price, kind });
|
|
59299
59465
|
return result;
|
|
59300
59466
|
return result?.filter((x) => {
|
|
@@ -59512,7 +59678,8 @@ class Signal {
|
|
|
59512
59678
|
kind = "long",
|
|
59513
59679
|
raw
|
|
59514
59680
|
}) {
|
|
59515
|
-
if (raw) {
|
|
59681
|
+
if (raw) {
|
|
59682
|
+
}
|
|
59516
59683
|
const margin_range = this.get_margin_range(current_price, kind);
|
|
59517
59684
|
let margin_zones = this.get_margin_zones({ current_price });
|
|
59518
59685
|
let remaining_zones = margin_zones.filter((x) => JSON.stringify(x) != JSON.stringify(margin_range));
|
|
@@ -59723,7 +59890,8 @@ class Signal {
|
|
|
59723
59890
|
return true;
|
|
59724
59891
|
});
|
|
59725
59892
|
let total_orders = limit_trades.concat(market_trades);
|
|
59726
|
-
if (kind === "short") {
|
|
59893
|
+
if (kind === "short") {
|
|
59894
|
+
}
|
|
59727
59895
|
if (this.minimum_size && total_orders.length > 0) {
|
|
59728
59896
|
let payload = total_orders;
|
|
59729
59897
|
let greater_than_min_size = total_orders.filter((o) => o ? o.quantity >= this.minimum_size : true);
|
|
@@ -59809,7 +59977,8 @@ class Signal {
|
|
|
59809
59977
|
});
|
|
59810
59978
|
const multiplier = start - index;
|
|
59811
59979
|
const incurred_fees = fees.reduce((a, b) => a + b, 0) + previous_risks.reduce((a, b) => a + b, 0);
|
|
59812
|
-
if (index === 0) {
|
|
59980
|
+
if (index === 0) {
|
|
59981
|
+
}
|
|
59813
59982
|
let quantity = determine_position_size2({
|
|
59814
59983
|
entry,
|
|
59815
59984
|
stop,
|
|
@@ -59907,7 +60076,8 @@ function buildConfig(app_config, {
|
|
|
59907
60076
|
return [];
|
|
59908
60077
|
}
|
|
59909
60078
|
const condition = (kind === "long" ? entry > app_config.support : entry >= app_config.support) && stop >= app_config.support * 0.999;
|
|
59910
|
-
if (kind === "short") {
|
|
60079
|
+
if (kind === "short") {
|
|
60080
|
+
}
|
|
59911
60081
|
const result = entry === stop ? [] : condition ? instance.build_entry({
|
|
59912
60082
|
current_price: entry,
|
|
59913
60083
|
stop_loss: stop,
|
|
@@ -61073,8 +61243,11 @@ class Strategy {
|
|
|
61073
61243
|
}
|
|
61074
61244
|
}
|
|
61075
61245
|
};
|
|
61076
|
-
results.push(to_add);
|
|
61077
61246
|
const sell_kind = direction == "long" ? "short" : "long";
|
|
61247
|
+
if (sell_quantity[sell_kind] <= 0) {
|
|
61248
|
+
break;
|
|
61249
|
+
}
|
|
61250
|
+
results.push(to_add);
|
|
61078
61251
|
const remaining = this.to_df(params[sell_kind].quantity - sell_quantity[sell_kind]);
|
|
61079
61252
|
if (remaining <= 0) {
|
|
61080
61253
|
break;
|
|
@@ -61375,7 +61548,8 @@ async function createLimitPurchaseOrders(client, symbol, priceFormat, quantityFo
|
|
|
61375
61548
|
const splitOrders = (inputOrders) => {
|
|
61376
61549
|
const result = [];
|
|
61377
61550
|
for (const o of inputOrders) {
|
|
61378
|
-
if (o.take_profit) {
|
|
61551
|
+
if (o.take_profit) {
|
|
61552
|
+
}
|
|
61379
61553
|
if (o.stop && !o.side) {
|
|
61380
61554
|
result.push({
|
|
61381
61555
|
price: o.price,
|
|
@@ -62302,7 +62476,8 @@ async function createLimitPurchaseOrders2(client, symbol, priceFormat, quantityF
|
|
|
62302
62476
|
const splitOrders = (inputOrders) => {
|
|
62303
62477
|
const result = [];
|
|
62304
62478
|
for (const o of inputOrders) {
|
|
62305
|
-
if (o.take_profit) {
|
|
62479
|
+
if (o.take_profit) {
|
|
62480
|
+
}
|
|
62306
62481
|
if (o.stop && !o.side) {
|
|
62307
62482
|
result.push({
|
|
62308
62483
|
price: o.price,
|
|
@@ -62903,9 +63078,12 @@ class BybitExchange extends BaseExchange {
|
|
|
62903
63078
|
sellLeverage: payload.leverage.toString()
|
|
62904
63079
|
});
|
|
62905
63080
|
}
|
|
62906
|
-
async generateConfig(payload) {
|
|
62907
|
-
|
|
62908
|
-
async
|
|
63081
|
+
async generateConfig(payload) {
|
|
63082
|
+
}
|
|
63083
|
+
async checkDelistedMovers(payload) {
|
|
63084
|
+
}
|
|
63085
|
+
async closePosition(payload) {
|
|
63086
|
+
}
|
|
62909
63087
|
async getAllOpenSymbols() {
|
|
62910
63088
|
return [];
|
|
62911
63089
|
}
|
|
@@ -62930,8 +63108,10 @@ class BybitExchange extends BaseExchange {
|
|
|
62930
63108
|
async getDelistedSpotSymbols() {
|
|
62931
63109
|
return [];
|
|
62932
63110
|
}
|
|
62933
|
-
async crossAccountTransfer(payload) {
|
|
62934
|
-
|
|
63111
|
+
async crossAccountTransfer(payload) {
|
|
63112
|
+
}
|
|
63113
|
+
async placeMarketOrder(payload) {
|
|
63114
|
+
}
|
|
62935
63115
|
async rawCreateLimitPurchaseOrders(payload) {
|
|
62936
63116
|
const { symbol, orders, price_places, decimal_places } = payload;
|
|
62937
63117
|
return createLimitPurchaseOrders2(this.client, symbol, price_places, decimal_places, orders);
|
|
@@ -62939,7 +63119,8 @@ class BybitExchange extends BaseExchange {
|
|
|
62939
63119
|
getOpenOrders(payload) {
|
|
62940
63120
|
return getOpenOrders2(this.client, payload.symbol);
|
|
62941
63121
|
}
|
|
62942
|
-
async placeBadStopEntry(payload) {
|
|
63122
|
+
async placeBadStopEntry(payload) {
|
|
63123
|
+
}
|
|
62943
63124
|
}
|
|
62944
63125
|
|
|
62945
63126
|
// src/helpers/accounts.ts
|
|
@@ -63893,7 +64074,8 @@ class ExchangeAccount {
|
|
|
63893
64074
|
cancelExchangeOrders: this.cancelExchangeOrders.bind(this)
|
|
63894
64075
|
});
|
|
63895
64076
|
}
|
|
63896
|
-
if (all) {
|
|
64077
|
+
if (all) {
|
|
64078
|
+
} else {
|
|
63897
64079
|
if (!price) {
|
|
63898
64080
|
const position2 = await this.syncAccount({
|
|
63899
64081
|
symbol,
|
|
@@ -65768,7 +65950,12 @@ class ExchangeAccount {
|
|
|
65768
65950
|
reward_factor = strategy.reward_factor;
|
|
65769
65951
|
}
|
|
65770
65952
|
if (focus_position.avg_qty >= focus_position.quantity && strategy.max_reward_factor) {
|
|
65771
|
-
|
|
65953
|
+
if (strategy.dynamic) {
|
|
65954
|
+
const quantity_ratio = focus_position.quantity / focus_position.avg_qty;
|
|
65955
|
+
reward_factor = to_f2(quantity_ratio ** 2 * strategy.max_reward_factor, "%.2f");
|
|
65956
|
+
} else {
|
|
65957
|
+
reward_factor = to_f2(focus_position.quantity * strategy.max_reward_factor / focus_position.avg_qty, "%.4f");
|
|
65958
|
+
}
|
|
65772
65959
|
} else {
|
|
65773
65960
|
reward_factor = strategy.reward_factor;
|
|
65774
65961
|
}
|
|
@@ -66561,7 +66748,8 @@ async function fetchExchangeDetails(payload) {
|
|
|
66561
66748
|
}
|
|
66562
66749
|
|
|
66563
66750
|
// src/mcp-server.ts
|
|
66564
|
-
console.log = (...args) => {
|
|
66751
|
+
console.log = (...args) => {
|
|
66752
|
+
};
|
|
66565
66753
|
var server = new McpServer({
|
|
66566
66754
|
name: "ultimate-trader",
|
|
66567
66755
|
version: "0.0.1",
|