@gbozee/ultimate 0.0.2-167 → 0.0.2-169
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-index.d.ts +23 -0
- package/dist/frontend-index.js +33 -14
- package/dist/index.cjs +212 -211
- package/dist/index.d.ts +66 -1
- package/dist/index.js +216 -219
- package/dist/mcp-client.cjs +25 -50
- package/dist/mcp-client.js +25 -50
- package/dist/mcp-server.cjs +214 -217
- package/dist/mcp-server.js +218 -225
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -229,8 +229,7 @@ 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 = () => {
|
|
233
|
-
};
|
|
232
|
+
var init_random = () => {};
|
|
234
233
|
|
|
235
234
|
// node_modules/jose/dist/node/esm/lib/iv.js
|
|
236
235
|
function bitLength(alg) {
|
|
@@ -271,8 +270,7 @@ var init_check_iv_length = __esm(() => {
|
|
|
271
270
|
// node_modules/jose/dist/node/esm/runtime/is_key_object.js
|
|
272
271
|
import * as util2 from "node:util";
|
|
273
272
|
var is_key_object_default = (obj) => util2.types.isKeyObject(obj);
|
|
274
|
-
var init_is_key_object = () => {
|
|
275
|
-
};
|
|
273
|
+
var init_is_key_object = () => {};
|
|
276
274
|
|
|
277
275
|
// node_modules/jose/dist/node/esm/runtime/check_cek_length.js
|
|
278
276
|
var checkCekLength = (enc, cek) => {
|
|
@@ -534,8 +532,7 @@ var ciphers, ciphers_default = (algorithm) => {
|
|
|
534
532
|
ciphers ||= new Set(getCiphers());
|
|
535
533
|
return ciphers.has(algorithm);
|
|
536
534
|
};
|
|
537
|
-
var init_ciphers = () => {
|
|
538
|
-
};
|
|
535
|
+
var init_ciphers = () => {};
|
|
539
536
|
|
|
540
537
|
// node_modules/jose/dist/node/esm/runtime/is_key_like.js
|
|
541
538
|
var is_key_like_default = (key) => is_key_object_default(key) || isCryptoKey(key), types3;
|
|
@@ -566,8 +563,7 @@ function cbcDecrypt(enc, cek, ciphertext, iv, tag, aad) {
|
|
|
566
563
|
let macCheckPassed;
|
|
567
564
|
try {
|
|
568
565
|
macCheckPassed = timing_safe_equal_default(tag, expectedTag);
|
|
569
|
-
} catch {
|
|
570
|
-
}
|
|
566
|
+
} catch {}
|
|
571
567
|
if (!macCheckPassed) {
|
|
572
568
|
throw new JWEDecryptionFailed;
|
|
573
569
|
}
|
|
@@ -575,8 +571,7 @@ function cbcDecrypt(enc, cek, ciphertext, iv, tag, aad) {
|
|
|
575
571
|
try {
|
|
576
572
|
const decipher = createDecipheriv(algorithm, encKey, iv);
|
|
577
573
|
plaintext = concat(decipher.update(ciphertext), decipher.final());
|
|
578
|
-
} catch {
|
|
579
|
-
}
|
|
574
|
+
} catch {}
|
|
580
575
|
if (!plaintext) {
|
|
581
576
|
throw new JWEDecryptionFailed;
|
|
582
577
|
}
|
|
@@ -754,8 +749,7 @@ function isPublicJWK(key) {
|
|
|
754
749
|
function isSecretJWK(key) {
|
|
755
750
|
return isJWK(key) && key.kty === "oct" && typeof key.k === "string";
|
|
756
751
|
}
|
|
757
|
-
var init_is_jwk = () => {
|
|
758
|
-
};
|
|
752
|
+
var init_is_jwk = () => {};
|
|
759
753
|
|
|
760
754
|
// node_modules/jose/dist/node/esm/runtime/get_named_curve.js
|
|
761
755
|
import { KeyObject as KeyObject3 } from "node:crypto";
|
|
@@ -938,14 +932,12 @@ var check_key_length_default = (key, alg) => {
|
|
|
938
932
|
} else {
|
|
939
933
|
modulusLength = Buffer.from(key.n, "base64url").byteLength << 3;
|
|
940
934
|
}
|
|
941
|
-
} catch {
|
|
942
|
-
}
|
|
935
|
+
} catch {}
|
|
943
936
|
if (typeof modulusLength !== "number" || modulusLength < 2048) {
|
|
944
937
|
throw new TypeError(`${alg} requires key modulusLength to be 2048 bits or larger`);
|
|
945
938
|
}
|
|
946
939
|
};
|
|
947
|
-
var init_check_key_length = () => {
|
|
948
|
-
};
|
|
940
|
+
var init_check_key_length = () => {};
|
|
949
941
|
|
|
950
942
|
// node_modules/jose/dist/node/esm/runtime/rsaes.js
|
|
951
943
|
import { KeyObject as KeyObject7, publicEncrypt, constants, privateDecrypt } from "node:crypto";
|
|
@@ -1699,8 +1691,7 @@ async function generalDecrypt(jwe, key, options) {
|
|
|
1699
1691
|
tag: jwe.tag,
|
|
1700
1692
|
unprotected: jwe.unprotected
|
|
1701
1693
|
}, key, options);
|
|
1702
|
-
} catch {
|
|
1703
|
-
}
|
|
1694
|
+
} catch {}
|
|
1704
1695
|
}
|
|
1705
1696
|
throw new JWEDecryptionFailed;
|
|
1706
1697
|
}
|
|
@@ -2585,8 +2576,7 @@ async function generalVerify(jws, key, options) {
|
|
|
2585
2576
|
protected: signature.protected,
|
|
2586
2577
|
signature: signature.signature
|
|
2587
2578
|
}, key, options);
|
|
2588
|
-
} catch {
|
|
2589
|
-
}
|
|
2579
|
+
} catch {}
|
|
2590
2580
|
}
|
|
2591
2581
|
throw new JWSSignatureVerificationFailed;
|
|
2592
2582
|
}
|
|
@@ -2669,8 +2659,7 @@ var normalizeTyp = (value) => value.toLowerCase().replace(/^application\//, ""),
|
|
|
2669
2659
|
let payload;
|
|
2670
2660
|
try {
|
|
2671
2661
|
payload = JSON.parse(decoder.decode(encodedPayload));
|
|
2672
|
-
} catch {
|
|
2673
|
-
}
|
|
2662
|
+
} catch {}
|
|
2674
2663
|
if (!isObject(payload)) {
|
|
2675
2664
|
throw new JWTInvalid("JWT Claims Set must be a top-level JSON object");
|
|
2676
2665
|
}
|
|
@@ -3355,8 +3344,7 @@ class LocalJWKSet {
|
|
|
3355
3344
|
for (const jwk2 of candidates) {
|
|
3356
3345
|
try {
|
|
3357
3346
|
yield await importWithAlgCache(_cached, jwk2, alg);
|
|
3358
|
-
} catch {
|
|
3359
|
-
}
|
|
3347
|
+
} catch {}
|
|
3360
3348
|
}
|
|
3361
3349
|
};
|
|
3362
3350
|
throw error;
|
|
@@ -3903,8 +3891,7 @@ var require_util = __commonJS((exports) => {
|
|
|
3903
3891
|
var util4;
|
|
3904
3892
|
(function(util5) {
|
|
3905
3893
|
util5.assertEqual = (val) => val;
|
|
3906
|
-
function assertIs(_arg) {
|
|
3907
|
-
}
|
|
3894
|
+
function assertIs(_arg) {}
|
|
3908
3895
|
util5.assertIs = assertIs;
|
|
3909
3896
|
function assertNever(_x) {
|
|
3910
3897
|
throw new Error;
|
|
@@ -6320,8 +6307,7 @@ var require_types = __commonJS((exports) => {
|
|
|
6320
6307
|
});
|
|
6321
6308
|
status.dirty();
|
|
6322
6309
|
}
|
|
6323
|
-
} else if (unknownKeys === "strip") {
|
|
6324
|
-
} else {
|
|
6310
|
+
} else if (unknownKeys === "strip") {} else {
|
|
6325
6311
|
throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
|
|
6326
6312
|
}
|
|
6327
6313
|
} else {
|
|
@@ -8473,8 +8459,7 @@ var require_logLevelLogger = __commonJS((exports) => {
|
|
|
8473
8459
|
if (typeof theFunc === "function" && maxLevel >= theLevel) {
|
|
8474
8460
|
return theFunc.bind(logger);
|
|
8475
8461
|
}
|
|
8476
|
-
return function() {
|
|
8477
|
-
};
|
|
8462
|
+
return function() {};
|
|
8478
8463
|
}
|
|
8479
8464
|
return {
|
|
8480
8465
|
error: _filterFunc("error", types_1.DiagLogLevel.ERROR),
|
|
@@ -8699,8 +8684,7 @@ var require_NoopMeter = __commonJS((exports) => {
|
|
|
8699
8684
|
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;
|
|
8700
8685
|
|
|
8701
8686
|
class NoopMeter {
|
|
8702
|
-
constructor() {
|
|
8703
|
-
}
|
|
8687
|
+
constructor() {}
|
|
8704
8688
|
createGauge(_name, _options) {
|
|
8705
8689
|
return exports.NOOP_GAUGE_METRIC;
|
|
8706
8690
|
}
|
|
@@ -8722,10 +8706,8 @@ var require_NoopMeter = __commonJS((exports) => {
|
|
|
8722
8706
|
createObservableUpDownCounter(_name, _options) {
|
|
8723
8707
|
return exports.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC;
|
|
8724
8708
|
}
|
|
8725
|
-
addBatchObservableCallback(_callback, _observables) {
|
|
8726
|
-
}
|
|
8727
|
-
removeBatchObservableCallback(_callback) {
|
|
8728
|
-
}
|
|
8709
|
+
addBatchObservableCallback(_callback, _observables) {}
|
|
8710
|
+
removeBatchObservableCallback(_callback) {}
|
|
8729
8711
|
}
|
|
8730
8712
|
exports.NoopMeter = NoopMeter;
|
|
8731
8713
|
|
|
@@ -8734,34 +8716,28 @@ var require_NoopMeter = __commonJS((exports) => {
|
|
|
8734
8716
|
exports.NoopMetric = NoopMetric;
|
|
8735
8717
|
|
|
8736
8718
|
class NoopCounterMetric extends NoopMetric {
|
|
8737
|
-
add(_value, _attributes) {
|
|
8738
|
-
}
|
|
8719
|
+
add(_value, _attributes) {}
|
|
8739
8720
|
}
|
|
8740
8721
|
exports.NoopCounterMetric = NoopCounterMetric;
|
|
8741
8722
|
|
|
8742
8723
|
class NoopUpDownCounterMetric extends NoopMetric {
|
|
8743
|
-
add(_value, _attributes) {
|
|
8744
|
-
}
|
|
8724
|
+
add(_value, _attributes) {}
|
|
8745
8725
|
}
|
|
8746
8726
|
exports.NoopUpDownCounterMetric = NoopUpDownCounterMetric;
|
|
8747
8727
|
|
|
8748
8728
|
class NoopGaugeMetric extends NoopMetric {
|
|
8749
|
-
record(_value, _attributes) {
|
|
8750
|
-
}
|
|
8729
|
+
record(_value, _attributes) {}
|
|
8751
8730
|
}
|
|
8752
8731
|
exports.NoopGaugeMetric = NoopGaugeMetric;
|
|
8753
8732
|
|
|
8754
8733
|
class NoopHistogramMetric extends NoopMetric {
|
|
8755
|
-
record(_value, _attributes) {
|
|
8756
|
-
}
|
|
8734
|
+
record(_value, _attributes) {}
|
|
8757
8735
|
}
|
|
8758
8736
|
exports.NoopHistogramMetric = NoopHistogramMetric;
|
|
8759
8737
|
|
|
8760
8738
|
class NoopObservableMetric {
|
|
8761
|
-
addCallback(_callback) {
|
|
8762
|
-
}
|
|
8763
|
-
removeCallback(_callback) {
|
|
8764
|
-
}
|
|
8739
|
+
addCallback(_callback) {}
|
|
8740
|
+
removeCallback(_callback) {}
|
|
8765
8741
|
}
|
|
8766
8742
|
exports.NoopObservableMetric = NoopObservableMetric;
|
|
8767
8743
|
|
|
@@ -8866,8 +8842,7 @@ var require_context2 = __commonJS((exports) => {
|
|
|
8866
8842
|
var NOOP_CONTEXT_MANAGER = new NoopContextManager_1.NoopContextManager;
|
|
8867
8843
|
|
|
8868
8844
|
class ContextAPI {
|
|
8869
|
-
constructor() {
|
|
8870
|
-
}
|
|
8845
|
+
constructor() {}
|
|
8871
8846
|
static getInstance() {
|
|
8872
8847
|
if (!this._instance) {
|
|
8873
8848
|
this._instance = new ContextAPI;
|
|
@@ -8956,13 +8931,11 @@ var require_NonRecordingSpan = __commonJS((exports) => {
|
|
|
8956
8931
|
updateName(_name) {
|
|
8957
8932
|
return this;
|
|
8958
8933
|
}
|
|
8959
|
-
end(_endTime) {
|
|
8960
|
-
}
|
|
8934
|
+
end(_endTime) {}
|
|
8961
8935
|
isRecording() {
|
|
8962
8936
|
return false;
|
|
8963
8937
|
}
|
|
8964
|
-
recordException(_exception, _time) {
|
|
8965
|
-
}
|
|
8938
|
+
recordException(_exception, _time) {}
|
|
8966
8939
|
}
|
|
8967
8940
|
exports.NonRecordingSpan = NonRecordingSpan;
|
|
8968
8941
|
});
|
|
@@ -9264,8 +9237,7 @@ var require_tracestate_impl = __commonJS((exports) => {
|
|
|
9264
9237
|
const value = listMember.slice(i + 1, part.length);
|
|
9265
9238
|
if ((0, tracestate_validators_1.validateKey)(key) && (0, tracestate_validators_1.validateValue)(value)) {
|
|
9266
9239
|
agg.set(key, value);
|
|
9267
|
-
} else {
|
|
9268
|
-
}
|
|
9240
|
+
} else {}
|
|
9269
9241
|
}
|
|
9270
9242
|
return agg;
|
|
9271
9243
|
}, new Map);
|
|
@@ -9337,8 +9309,7 @@ var require_metrics = __commonJS((exports) => {
|
|
|
9337
9309
|
var API_NAME2 = "metrics";
|
|
9338
9310
|
|
|
9339
9311
|
class MetricsAPI {
|
|
9340
|
-
constructor() {
|
|
9341
|
-
}
|
|
9312
|
+
constructor() {}
|
|
9342
9313
|
static getInstance() {
|
|
9343
9314
|
if (!this._instance) {
|
|
9344
9315
|
this._instance = new MetricsAPI;
|
|
@@ -9375,8 +9346,7 @@ var require_NoopTextMapPropagator = __commonJS((exports) => {
|
|
|
9375
9346
|
exports.NoopTextMapPropagator = undefined;
|
|
9376
9347
|
|
|
9377
9348
|
class NoopTextMapPropagator {
|
|
9378
|
-
inject(_context, _carrier) {
|
|
9379
|
-
}
|
|
9349
|
+
inject(_context, _carrier) {}
|
|
9380
9350
|
extract(context, _carrier) {
|
|
9381
9351
|
return context;
|
|
9382
9352
|
}
|
|
@@ -9689,8 +9659,7 @@ class Registry {
|
|
|
9689
9659
|
return this.kv.getByKey(identifier);
|
|
9690
9660
|
}
|
|
9691
9661
|
}
|
|
9692
|
-
var init_registry = () => {
|
|
9693
|
-
};
|
|
9662
|
+
var init_registry = () => {};
|
|
9694
9663
|
|
|
9695
9664
|
// node_modules/superjson/dist/class-registry.js
|
|
9696
9665
|
var ClassRegistry;
|
|
@@ -9775,8 +9744,7 @@ class CustomTransformerRegistry {
|
|
|
9775
9744
|
return this.transfomers[name2];
|
|
9776
9745
|
}
|
|
9777
9746
|
}
|
|
9778
|
-
var init_custom_transformer_registry = () => {
|
|
9779
|
-
};
|
|
9747
|
+
var init_custom_transformer_registry = () => {};
|
|
9780
9748
|
|
|
9781
9749
|
// node_modules/superjson/dist/is.js
|
|
9782
9750
|
var getType = (payload) => Object.prototype.toString.call(payload).slice(8, -1), isUndefined = (payload) => typeof payload === "undefined", isNull = (payload) => payload === null, isPlainObject = (payload) => {
|
|
@@ -10121,8 +10089,7 @@ var getNthKey = (value, n) => {
|
|
|
10121
10089
|
}
|
|
10122
10090
|
return object;
|
|
10123
10091
|
};
|
|
10124
|
-
var init_accessDeep = () => {
|
|
10125
|
-
};
|
|
10092
|
+
var init_accessDeep = () => {};
|
|
10126
10093
|
|
|
10127
10094
|
// node_modules/superjson/dist/plainer.js
|
|
10128
10095
|
function traverse(tree, walker, origin = []) {
|
|
@@ -10711,8 +10678,7 @@ var require_NoopLogger = __commonJS((exports) => {
|
|
|
10711
10678
|
exports.NOOP_LOGGER = exports.NoopLogger = undefined;
|
|
10712
10679
|
|
|
10713
10680
|
class NoopLogger {
|
|
10714
|
-
emit(_logRecord) {
|
|
10715
|
-
}
|
|
10681
|
+
emit(_logRecord) {}
|
|
10716
10682
|
}
|
|
10717
10683
|
exports.NoopLogger = NoopLogger;
|
|
10718
10684
|
exports.NOOP_LOGGER = new NoopLogger;
|
|
@@ -10806,8 +10772,7 @@ var require_logs = __commonJS((exports) => {
|
|
|
10806
10772
|
var NoopLoggerProvider_1 = require_NoopLoggerProvider();
|
|
10807
10773
|
|
|
10808
10774
|
class LogsAPI {
|
|
10809
|
-
constructor() {
|
|
10810
|
-
}
|
|
10775
|
+
constructor() {}
|
|
10811
10776
|
static getInstance() {
|
|
10812
10777
|
if (!this._instance) {
|
|
10813
10778
|
this._instance = new LogsAPI;
|
|
@@ -11275,8 +11240,7 @@ var require_browser = __commonJS((exports, module) => {
|
|
|
11275
11240
|
});
|
|
11276
11241
|
args.splice(lastC, 0, c);
|
|
11277
11242
|
}
|
|
11278
|
-
exports.log = console.debug || console.log || (() => {
|
|
11279
|
-
});
|
|
11243
|
+
exports.log = console.debug || console.log || (() => {});
|
|
11280
11244
|
function save(namespaces) {
|
|
11281
11245
|
try {
|
|
11282
11246
|
if (namespaces) {
|
|
@@ -11284,15 +11248,13 @@ var require_browser = __commonJS((exports, module) => {
|
|
|
11284
11248
|
} else {
|
|
11285
11249
|
exports.storage.removeItem("debug");
|
|
11286
11250
|
}
|
|
11287
|
-
} catch (error) {
|
|
11288
|
-
}
|
|
11251
|
+
} catch (error) {}
|
|
11289
11252
|
}
|
|
11290
11253
|
function load() {
|
|
11291
11254
|
let r;
|
|
11292
11255
|
try {
|
|
11293
11256
|
r = exports.storage.getItem("debug");
|
|
11294
|
-
} catch (error) {
|
|
11295
|
-
}
|
|
11257
|
+
} catch (error) {}
|
|
11296
11258
|
if (!r && typeof process !== "undefined" && "env" in process) {
|
|
11297
11259
|
r = process.env.DEBUG;
|
|
11298
11260
|
}
|
|
@@ -11301,8 +11263,7 @@ var require_browser = __commonJS((exports, module) => {
|
|
|
11301
11263
|
function localstorage() {
|
|
11302
11264
|
try {
|
|
11303
11265
|
return localStorage;
|
|
11304
|
-
} catch (error) {
|
|
11305
|
-
}
|
|
11266
|
+
} catch (error) {}
|
|
11306
11267
|
}
|
|
11307
11268
|
module.exports = require_common()(exports);
|
|
11308
11269
|
var { formatters } = module.exports;
|
|
@@ -11434,8 +11395,7 @@ var require_node3 = __commonJS((exports, module) => {
|
|
|
11434
11395
|
exports.save = save;
|
|
11435
11396
|
exports.load = load;
|
|
11436
11397
|
exports.useColors = useColors;
|
|
11437
|
-
exports.destroy = util4.deprecate(() => {
|
|
11438
|
-
}, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
11398
|
+
exports.destroy = util4.deprecate(() => {}, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
11439
11399
|
exports.colors = [6, 2, 3, 4, 5, 1];
|
|
11440
11400
|
try {
|
|
11441
11401
|
const supportsColor = require_supports_color();
|
|
@@ -11519,8 +11479,7 @@ var require_node3 = __commonJS((exports, module) => {
|
|
|
11519
11479
|
221
|
|
11520
11480
|
];
|
|
11521
11481
|
}
|
|
11522
|
-
} catch (error) {
|
|
11523
|
-
}
|
|
11482
|
+
} catch (error) {}
|
|
11524
11483
|
exports.inspectOpts = Object.keys(process.env).filter((key) => {
|
|
11525
11484
|
return /^debug_/i.test(key);
|
|
11526
11485
|
}).reduce((obj, key) => {
|
|
@@ -13769,8 +13728,7 @@ var require_jsbn = __commonJS((exports, module) => {
|
|
|
13769
13728
|
++this[w];
|
|
13770
13729
|
}
|
|
13771
13730
|
}
|
|
13772
|
-
function NullExp() {
|
|
13773
|
-
}
|
|
13731
|
+
function NullExp() {}
|
|
13774
13732
|
function nNop(x) {
|
|
13775
13733
|
return x;
|
|
13776
13734
|
}
|
|
@@ -14195,8 +14153,7 @@ var require_jsbn = __commonJS((exports, module) => {
|
|
|
14195
14153
|
for (i2 = 0;i2 < ba.length; ++i2)
|
|
14196
14154
|
ba[i2] = rng_get_byte();
|
|
14197
14155
|
}
|
|
14198
|
-
function SecureRandom() {
|
|
14199
|
-
}
|
|
14156
|
+
function SecureRandom() {}
|
|
14200
14157
|
SecureRandom.prototype.nextBytes = rng_get_bytes;
|
|
14201
14158
|
function Arcfour() {
|
|
14202
14159
|
this.i = 0;
|
|
@@ -16419,8 +16376,7 @@ var require_delayed_stream = __commonJS((exports, module) => {
|
|
|
16419
16376
|
delayedStream._handleEmit(arguments);
|
|
16420
16377
|
return realEmit.apply(source, arguments);
|
|
16421
16378
|
};
|
|
16422
|
-
source.on("error", function() {
|
|
16423
|
-
});
|
|
16379
|
+
source.on("error", function() {});
|
|
16424
16380
|
if (delayedStream.pauseStream) {
|
|
16425
16381
|
source.pause();
|
|
16426
16382
|
}
|
|
@@ -25724,8 +25680,7 @@ var require_implementation = __commonJS((exports, module) => {
|
|
|
25724
25680
|
}
|
|
25725
25681
|
bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
|
|
25726
25682
|
if (target.prototype) {
|
|
25727
|
-
var Empty = function Empty() {
|
|
25728
|
-
};
|
|
25683
|
+
var Empty = function Empty() {};
|
|
25729
25684
|
Empty.prototype = target.prototype;
|
|
25730
25685
|
bound.prototype = new Empty;
|
|
25731
25686
|
Empty.prototype = null;
|
|
@@ -25845,8 +25800,7 @@ var require_get_intrinsic = __commonJS((exports, module) => {
|
|
|
25845
25800
|
var getEvalledConstructor = function(expressionSyntax) {
|
|
25846
25801
|
try {
|
|
25847
25802
|
return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")();
|
|
25848
|
-
} catch (e2) {
|
|
25849
|
-
}
|
|
25803
|
+
} catch (e2) {}
|
|
25850
25804
|
};
|
|
25851
25805
|
var $gOPD = require_gopd();
|
|
25852
25806
|
var $defineProperty = require_es_define_property();
|
|
@@ -26585,11 +26539,9 @@ var require_debug = __commonJS((exports, module) => {
|
|
|
26585
26539
|
if (!debug) {
|
|
26586
26540
|
try {
|
|
26587
26541
|
debug = require_src4()("follow-redirects");
|
|
26588
|
-
} catch (error) {
|
|
26589
|
-
}
|
|
26542
|
+
} catch (error) {}
|
|
26590
26543
|
if (typeof debug !== "function") {
|
|
26591
|
-
debug = function() {
|
|
26592
|
-
};
|
|
26544
|
+
debug = function() {};
|
|
26593
26545
|
}
|
|
26594
26546
|
}
|
|
26595
26547
|
debug.apply(null, arguments);
|
|
@@ -26964,8 +26916,7 @@ var require_follow_redirects = __commonJS((exports, module) => {
|
|
|
26964
26916
|
});
|
|
26965
26917
|
return exports2;
|
|
26966
26918
|
}
|
|
26967
|
-
function noop2() {
|
|
26968
|
-
}
|
|
26919
|
+
function noop2() {}
|
|
26969
26920
|
function parseUrl(input) {
|
|
26970
26921
|
var parsed;
|
|
26971
26922
|
if (useNativeURL) {
|
|
@@ -27348,8 +27299,7 @@ var require_axios = __commonJS((exports, module) => {
|
|
|
27348
27299
|
isArray3(arrayOrString) ? define2(arrayOrString) : define2(String(arrayOrString).split(delimiter));
|
|
27349
27300
|
return obj;
|
|
27350
27301
|
};
|
|
27351
|
-
var noop2 = () => {
|
|
27352
|
-
};
|
|
27302
|
+
var noop2 = () => {};
|
|
27353
27303
|
var toFiniteNumber = (value, defaultValue) => {
|
|
27354
27304
|
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
|
27355
27305
|
};
|
|
@@ -28802,8 +28752,7 @@ var require_axios = __commonJS((exports, module) => {
|
|
|
28802
28752
|
try {
|
|
28803
28753
|
const knownLength = await util__default["default"].promisify(data.getLength).call(data);
|
|
28804
28754
|
Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);
|
|
28805
|
-
} catch (e2) {
|
|
28806
|
-
}
|
|
28755
|
+
} catch (e2) {}
|
|
28807
28756
|
}
|
|
28808
28757
|
} else if (utils$1.isBlob(data) || utils$1.isFile(data)) {
|
|
28809
28758
|
data.size && headers.setContentType(data.type || "application/octet-stream");
|
|
@@ -29077,13 +29026,11 @@ var require_axios = __commonJS((exports, module) => {
|
|
|
29077
29026
|
this.write(name2, "", Date.now() - 86400000);
|
|
29078
29027
|
}
|
|
29079
29028
|
} : {
|
|
29080
|
-
write() {
|
|
29081
|
-
},
|
|
29029
|
+
write() {},
|
|
29082
29030
|
read() {
|
|
29083
29031
|
return null;
|
|
29084
29032
|
},
|
|
29085
|
-
remove() {
|
|
29086
|
-
}
|
|
29033
|
+
remove() {}
|
|
29087
29034
|
};
|
|
29088
29035
|
var headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
|
|
29089
29036
|
function mergeConfig(config1, config2) {
|
|
@@ -29577,8 +29524,7 @@ var require_axios = __commonJS((exports, module) => {
|
|
|
29577
29524
|
if (fn) {
|
|
29578
29525
|
try {
|
|
29579
29526
|
Object.defineProperty(fn, "name", { value });
|
|
29580
|
-
} catch (e2) {
|
|
29581
|
-
}
|
|
29527
|
+
} catch (e2) {}
|
|
29582
29528
|
Object.defineProperty(fn, "adapterName", { value });
|
|
29583
29529
|
}
|
|
29584
29530
|
});
|
|
@@ -29728,8 +29674,7 @@ var require_axios = __commonJS((exports, module) => {
|
|
|
29728
29674
|
err.stack += `
|
|
29729
29675
|
` + stack;
|
|
29730
29676
|
}
|
|
29731
|
-
} catch (e2) {
|
|
29732
|
-
}
|
|
29677
|
+
} catch (e2) {}
|
|
29733
29678
|
}
|
|
29734
29679
|
throw err;
|
|
29735
29680
|
}
|
|
@@ -31802,8 +31747,7 @@ var require_logger = __commonJS((exports) => {
|
|
|
31802
31747
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31803
31748
|
exports.DefaultLogger = undefined;
|
|
31804
31749
|
exports.DefaultLogger = {
|
|
31805
|
-
silly: (...params) => {
|
|
31806
|
-
},
|
|
31750
|
+
silly: (...params) => {},
|
|
31807
31751
|
debug: (...params) => {
|
|
31808
31752
|
console.log(new Date, params);
|
|
31809
31753
|
},
|
|
@@ -34546,8 +34490,7 @@ var require_constants4 = __commonJS((exports, module) => {
|
|
|
34546
34490
|
kListener: Symbol("kListener"),
|
|
34547
34491
|
kStatusCode: Symbol("status-code"),
|
|
34548
34492
|
kWebSocket: Symbol("websocket"),
|
|
34549
|
-
NOOP: () => {
|
|
34550
|
-
}
|
|
34493
|
+
NOOP: () => {}
|
|
34551
34494
|
};
|
|
34552
34495
|
});
|
|
34553
34496
|
|
|
@@ -34625,8 +34568,7 @@ var require_buffer_util = __commonJS((exports, module) => {
|
|
|
34625
34568
|
else
|
|
34626
34569
|
bufferUtil.unmask(buffer, mask);
|
|
34627
34570
|
};
|
|
34628
|
-
} catch (e2) {
|
|
34629
|
-
}
|
|
34571
|
+
} catch (e2) {}
|
|
34630
34572
|
}
|
|
34631
34573
|
});
|
|
34632
34574
|
|
|
@@ -35105,8 +35047,7 @@ var require_validation = __commonJS((exports, module) => {
|
|
|
35105
35047
|
module.exports.isValidUTF8 = function(buf) {
|
|
35106
35048
|
return buf.length < 32 ? _isValidUTF8(buf) : isValidUTF8(buf);
|
|
35107
35049
|
};
|
|
35108
|
-
} catch (e2) {
|
|
35109
|
-
}
|
|
35050
|
+
} catch (e2) {}
|
|
35110
35051
|
}
|
|
35111
35052
|
});
|
|
35112
35053
|
|
|
@@ -37531,8 +37472,7 @@ var require_websocket_client = __commonJS((exports) => {
|
|
|
37531
37472
|
this.options = Object.assign({ pongTimeout: 7500, pingInterval: 1e4, reconnectTimeout: 500 }, options);
|
|
37532
37473
|
this.listenKeyStateStore = {};
|
|
37533
37474
|
this.wsUrlKeyMap = {};
|
|
37534
|
-
this.on("error", () => {
|
|
37535
|
-
});
|
|
37475
|
+
this.on("error", () => {});
|
|
37536
37476
|
}
|
|
37537
37477
|
getRestClientOptions() {
|
|
37538
37478
|
return Object.assign(Object.assign(Object.assign({}, this.options), this.options.restOptions), { api_key: this.options.api_key, api_secret: this.options.api_secret });
|
|
@@ -38750,8 +38690,7 @@ var require_axios2 = __commonJS((exports, module) => {
|
|
|
38750
38690
|
isArray3(arrayOrString) ? define2(arrayOrString) : define2(String(arrayOrString).split(delimiter));
|
|
38751
38691
|
return obj;
|
|
38752
38692
|
};
|
|
38753
|
-
var noop2 = () => {
|
|
38754
|
-
};
|
|
38693
|
+
var noop2 = () => {};
|
|
38755
38694
|
var toFiniteNumber = (value2, defaultValue) => {
|
|
38756
38695
|
return value2 != null && Number.isFinite(value2 = +value2) ? value2 : defaultValue;
|
|
38757
38696
|
};
|
|
@@ -40204,8 +40143,7 @@ var require_axios2 = __commonJS((exports, module) => {
|
|
|
40204
40143
|
try {
|
|
40205
40144
|
const knownLength = await util__default["default"].promisify(data.getLength).call(data);
|
|
40206
40145
|
Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);
|
|
40207
|
-
} catch (e2) {
|
|
40208
|
-
}
|
|
40146
|
+
} catch (e2) {}
|
|
40209
40147
|
}
|
|
40210
40148
|
} else if (utils$1.isBlob(data) || utils$1.isFile(data)) {
|
|
40211
40149
|
data.size && headers.setContentType(data.type || "application/octet-stream");
|
|
@@ -40479,13 +40417,11 @@ var require_axios2 = __commonJS((exports, module) => {
|
|
|
40479
40417
|
this.write(name2, "", Date.now() - 86400000);
|
|
40480
40418
|
}
|
|
40481
40419
|
} : {
|
|
40482
|
-
write() {
|
|
40483
|
-
},
|
|
40420
|
+
write() {},
|
|
40484
40421
|
read() {
|
|
40485
40422
|
return null;
|
|
40486
40423
|
},
|
|
40487
|
-
remove() {
|
|
40488
|
-
}
|
|
40424
|
+
remove() {}
|
|
40489
40425
|
};
|
|
40490
40426
|
var headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
|
|
40491
40427
|
function mergeConfig(config1, config2) {
|
|
@@ -40979,8 +40915,7 @@ var require_axios2 = __commonJS((exports, module) => {
|
|
|
40979
40915
|
if (fn) {
|
|
40980
40916
|
try {
|
|
40981
40917
|
Object.defineProperty(fn, "name", { value: value2 });
|
|
40982
|
-
} catch (e2) {
|
|
40983
|
-
}
|
|
40918
|
+
} catch (e2) {}
|
|
40984
40919
|
Object.defineProperty(fn, "adapterName", { value: value2 });
|
|
40985
40920
|
}
|
|
40986
40921
|
});
|
|
@@ -41130,8 +41065,7 @@ var require_axios2 = __commonJS((exports, module) => {
|
|
|
41130
41065
|
err.stack += `
|
|
41131
41066
|
` + stack;
|
|
41132
41067
|
}
|
|
41133
|
-
} catch (e2) {
|
|
41134
|
-
}
|
|
41068
|
+
} catch (e2) {}
|
|
41135
41069
|
}
|
|
41136
41070
|
throw err;
|
|
41137
41071
|
}
|
|
@@ -42000,8 +41934,7 @@ var require_logger2 = __commonJS((exports) => {
|
|
|
42000
41934
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42001
41935
|
exports.DefaultLogger = undefined;
|
|
42002
41936
|
exports.DefaultLogger = {
|
|
42003
|
-
trace: (..._params) => {
|
|
42004
|
-
},
|
|
41937
|
+
trace: (..._params) => {},
|
|
42005
41938
|
info: (...params) => {
|
|
42006
41939
|
console.info(params);
|
|
42007
41940
|
},
|
|
@@ -44047,8 +43980,7 @@ var require_BaseWSClient = __commonJS((exports) => {
|
|
|
44047
43980
|
if (wsState === null || wsState === undefined ? undefined : wsState.activePongTimer) {
|
|
44048
43981
|
clearTimeout(wsState.activePongTimer);
|
|
44049
43982
|
wsState.activePongTimer = undefined;
|
|
44050
|
-
} else {
|
|
44051
|
-
}
|
|
43983
|
+
} else {}
|
|
44052
43984
|
}
|
|
44053
43985
|
clearReconnectTimer(wsKey) {
|
|
44054
43986
|
const wsState = this.wsStore.get(wsKey);
|
|
@@ -44928,8 +44860,7 @@ __export(exports_app, {
|
|
|
44928
44860
|
var util;
|
|
44929
44861
|
(function(util2) {
|
|
44930
44862
|
util2.assertEqual = (val) => val;
|
|
44931
|
-
function assertIs(_arg) {
|
|
44932
|
-
}
|
|
44863
|
+
function assertIs(_arg) {}
|
|
44933
44864
|
util2.assertIs = assertIs;
|
|
44934
44865
|
function assertNever(_x) {
|
|
44935
44866
|
throw new Error;
|
|
@@ -49790,8 +49721,7 @@ var API_NAME = "task-context";
|
|
|
49790
49721
|
|
|
49791
49722
|
class TaskContextAPI {
|
|
49792
49723
|
static _instance;
|
|
49793
|
-
constructor() {
|
|
49794
|
-
}
|
|
49724
|
+
constructor() {}
|
|
49795
49725
|
static getInstance() {
|
|
49796
49726
|
if (!this._instance) {
|
|
49797
49727
|
this._instance = new TaskContextAPI;
|
|
@@ -50211,8 +50141,7 @@ class ParseError extends Error {
|
|
|
50211
50141
|
super(message2), this.name = "ParseError", this.type = options.type, this.field = options.field, this.value = options.value, this.line = options.line;
|
|
50212
50142
|
}
|
|
50213
50143
|
}
|
|
50214
|
-
function noop(_arg) {
|
|
50215
|
-
}
|
|
50144
|
+
function noop(_arg) {}
|
|
50216
50145
|
function createParser(callbacks) {
|
|
50217
50146
|
if (typeof callbacks == "function")
|
|
50218
50147
|
throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");
|
|
@@ -50415,8 +50344,7 @@ async function _doZodFetchWithRetries(schema, url, requestInit, options, attempt
|
|
|
50415
50344
|
if (error instanceof ApiError) {
|
|
50416
50345
|
throw error;
|
|
50417
50346
|
}
|
|
50418
|
-
if (error instanceof import_zod_validation_error.ValidationError) {
|
|
50419
|
-
}
|
|
50347
|
+
if (error instanceof import_zod_validation_error.ValidationError) {}
|
|
50420
50348
|
if (options?.retry) {
|
|
50421
50349
|
const retry = { ...defaultRetryOptions2, ...options.retry };
|
|
50422
50350
|
const delay = calculateNextRetryDelay(retry, attempt);
|
|
@@ -50890,8 +50818,7 @@ class ApiClientMissingError extends Error {
|
|
|
50890
50818
|
|
|
50891
50819
|
class APIClientManagerAPI {
|
|
50892
50820
|
static _instance;
|
|
50893
|
-
constructor() {
|
|
50894
|
-
}
|
|
50821
|
+
constructor() {}
|
|
50895
50822
|
static getInstance() {
|
|
50896
50823
|
if (!this._instance) {
|
|
50897
50824
|
this._instance = new APIClientManagerAPI;
|
|
@@ -51446,8 +51373,7 @@ var PrefetchQueue = class {
|
|
|
51446
51373
|
if (__privateGet(this, _queueTailUrl) && !__privateGet(this, _prefetchQueue).has(__privateGet(this, _queueTailUrl))) {
|
|
51447
51374
|
__privateMethod(this, _PrefetchQueue_instances, prefetch_fn).call(this, __privateGet(this, _queueTailUrl), args[1]);
|
|
51448
51375
|
}
|
|
51449
|
-
}).catch(() => {
|
|
51450
|
-
});
|
|
51376
|
+
}).catch(() => {});
|
|
51451
51377
|
return request;
|
|
51452
51378
|
}
|
|
51453
51379
|
};
|
|
@@ -51478,10 +51404,8 @@ prefetch_fn = function(...args) {
|
|
|
51478
51404
|
}
|
|
51479
51405
|
__privateSet(this, _queueTailUrl, nextUrl);
|
|
51480
51406
|
return __privateMethod(this, _PrefetchQueue_instances, prefetch_fn).call(this, nextUrl, args[1]);
|
|
51481
|
-
}).catch(() => {
|
|
51482
|
-
|
|
51483
|
-
} catch (_) {
|
|
51484
|
-
}
|
|
51407
|
+
}).catch(() => {});
|
|
51408
|
+
} catch (_) {}
|
|
51485
51409
|
};
|
|
51486
51410
|
function getNextChunkUrl(url, res) {
|
|
51487
51411
|
const shapeHandle = res.headers.get(SHAPE_HANDLE_HEADER);
|
|
@@ -51584,8 +51508,7 @@ var ShapeStream = class {
|
|
|
51584
51508
|
get lastOffset() {
|
|
51585
51509
|
return __privateGet(this, _lastOffset);
|
|
51586
51510
|
}
|
|
51587
|
-
subscribe(callback, onError = () => {
|
|
51588
|
-
}) {
|
|
51511
|
+
subscribe(callback, onError = () => {}) {
|
|
51589
51512
|
const subscriptionId = Math.random();
|
|
51590
51513
|
__privateGet(this, _subscribers).set(subscriptionId, [callback, onError]);
|
|
51591
51514
|
return () => {
|
|
@@ -52779,8 +52702,7 @@ class SimpleClock {
|
|
|
52779
52702
|
const nowStruct = now.toStruct();
|
|
52780
52703
|
return [nowStruct.seconds, nowStruct.nanos];
|
|
52781
52704
|
}
|
|
52782
|
-
reset() {
|
|
52783
|
-
}
|
|
52705
|
+
reset() {}
|
|
52784
52706
|
}
|
|
52785
52707
|
|
|
52786
52708
|
// node_modules/@trigger.dev/core/dist/esm/v3/clock/index.js
|
|
@@ -52789,8 +52711,7 @@ var SIMPLE_CLOCK = new SimpleClock;
|
|
|
52789
52711
|
|
|
52790
52712
|
class ClockAPI {
|
|
52791
52713
|
static _instance;
|
|
52792
|
-
constructor() {
|
|
52793
|
-
}
|
|
52714
|
+
constructor() {}
|
|
52794
52715
|
static getInstance() {
|
|
52795
52716
|
if (!this._instance) {
|
|
52796
52717
|
this._instance = new ClockAPI;
|
|
@@ -52816,8 +52737,7 @@ var clock = ClockAPI.getInstance();
|
|
|
52816
52737
|
|
|
52817
52738
|
// node_modules/@trigger.dev/core/dist/esm/v3/usage/noopUsageManager.js
|
|
52818
52739
|
class NoopUsageManager {
|
|
52819
|
-
disable() {
|
|
52820
|
-
}
|
|
52740
|
+
disable() {}
|
|
52821
52741
|
start() {
|
|
52822
52742
|
return {
|
|
52823
52743
|
sample: () => ({ cpuTime: 0, wallTime: 0 })
|
|
@@ -52840,8 +52760,7 @@ var NOOP_USAGE_MANAGER = new NoopUsageManager;
|
|
|
52840
52760
|
|
|
52841
52761
|
class UsageAPI {
|
|
52842
52762
|
static _instance;
|
|
52843
|
-
constructor() {
|
|
52844
|
-
}
|
|
52763
|
+
constructor() {}
|
|
52845
52764
|
static getInstance() {
|
|
52846
52765
|
if (!this._instance) {
|
|
52847
52766
|
this._instance = new UsageAPI;
|
|
@@ -52901,8 +52820,7 @@ class NoopRunMetadataManager {
|
|
|
52901
52820
|
refresh(requestOptions) {
|
|
52902
52821
|
throw new Error("Method not implemented.");
|
|
52903
52822
|
}
|
|
52904
|
-
enterWithMetadata(metadata) {
|
|
52905
|
-
}
|
|
52823
|
+
enterWithMetadata(metadata) {}
|
|
52906
52824
|
current() {
|
|
52907
52825
|
throw new Error("Method not implemented.");
|
|
52908
52826
|
}
|
|
@@ -52958,8 +52876,7 @@ var NOOP_MANAGER = new NoopRunMetadataManager;
|
|
|
52958
52876
|
|
|
52959
52877
|
class RunMetadataAPI {
|
|
52960
52878
|
static _instance;
|
|
52961
|
-
constructor() {
|
|
52962
|
-
}
|
|
52879
|
+
constructor() {}
|
|
52963
52880
|
static getInstance() {
|
|
52964
52881
|
if (!this._instance) {
|
|
52965
52882
|
this._instance = new RunMetadataAPI;
|
|
@@ -53044,8 +52961,7 @@ var NOOP_TIMEOUT_MANAGER = new NoopTimeoutManager;
|
|
|
53044
52961
|
|
|
53045
52962
|
class TimeoutAPI {
|
|
53046
52963
|
static _instance;
|
|
53047
|
-
constructor() {
|
|
53048
|
-
}
|
|
52964
|
+
constructor() {}
|
|
53049
52965
|
static getInstance() {
|
|
53050
52966
|
if (!this._instance) {
|
|
53051
52967
|
this._instance = new TimeoutAPI;
|
|
@@ -53456,8 +53372,7 @@ function getTokenPayload(e2) {
|
|
|
53456
53372
|
return "%" + ("00" + e3.charCodeAt(0).toString(16)).slice(-2);
|
|
53457
53373
|
}).join(""));
|
|
53458
53374
|
return JSON.parse(t2) || {};
|
|
53459
|
-
} catch (e3) {
|
|
53460
|
-
}
|
|
53375
|
+
} catch (e3) {}
|
|
53461
53376
|
return {};
|
|
53462
53377
|
}
|
|
53463
53378
|
function isTokenExpired(e2, t2 = 0) {
|
|
@@ -53511,8 +53426,7 @@ class BaseAuthStore {
|
|
|
53511
53426
|
let n = {};
|
|
53512
53427
|
try {
|
|
53513
53428
|
n = JSON.parse(s2), (typeof n === null || typeof n != "object" || Array.isArray(n)) && (n = {});
|
|
53514
|
-
} catch (e3) {
|
|
53515
|
-
}
|
|
53429
|
+
} catch (e3) {}
|
|
53516
53430
|
this.save(n.token || "", n.record || n.model || null);
|
|
53517
53431
|
}
|
|
53518
53432
|
exportToCookie(e2, t2 = i) {
|
|
@@ -53659,8 +53573,7 @@ class RealtimeService extends BaseService {
|
|
|
53659
53573
|
let i3;
|
|
53660
53574
|
try {
|
|
53661
53575
|
i3 = JSON.parse(s3?.data);
|
|
53662
|
-
} catch {
|
|
53663
|
-
}
|
|
53576
|
+
} catch {}
|
|
53664
53577
|
t2(i3 || {});
|
|
53665
53578
|
};
|
|
53666
53579
|
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);
|
|
@@ -54373,8 +54286,7 @@ class Client {
|
|
|
54373
54286
|
let s3 = {};
|
|
54374
54287
|
try {
|
|
54375
54288
|
s3 = await e3.json();
|
|
54376
|
-
} catch (e4) {
|
|
54377
|
-
}
|
|
54289
|
+
} catch (e4) {}
|
|
54378
54290
|
if (this.afterSend && (s3 = await this.afterSend(e3, s3, t2)), e3.status >= 400)
|
|
54379
54291
|
throw new ClientResponseError({ url: e3.url, status: e3.status, data: s3 });
|
|
54380
54292
|
return s3;
|
|
@@ -55908,8 +55820,7 @@ class Signal {
|
|
|
55908
55820
|
support: kind === "long" ? _stop_loss : this.support
|
|
55909
55821
|
};
|
|
55910
55822
|
const instance = new Signal(derivedConfig);
|
|
55911
|
-
if (kind === "short") {
|
|
55912
|
-
}
|
|
55823
|
+
if (kind === "short") {}
|
|
55913
55824
|
let result = instance.get_bulk_trade_zones({ current_price, kind });
|
|
55914
55825
|
return result;
|
|
55915
55826
|
return result?.filter((x) => {
|
|
@@ -56127,8 +56038,7 @@ class Signal {
|
|
|
56127
56038
|
kind = "long",
|
|
56128
56039
|
raw
|
|
56129
56040
|
}) {
|
|
56130
|
-
if (raw) {
|
|
56131
|
-
}
|
|
56041
|
+
if (raw) {}
|
|
56132
56042
|
const margin_range = this.get_margin_range(current_price, kind);
|
|
56133
56043
|
let margin_zones = this.get_margin_zones({ current_price });
|
|
56134
56044
|
let remaining_zones = margin_zones.filter((x) => JSON.stringify(x) != JSON.stringify(margin_range));
|
|
@@ -56355,8 +56265,7 @@ class Signal {
|
|
|
56355
56265
|
return true;
|
|
56356
56266
|
});
|
|
56357
56267
|
let total_orders = limit_trades.concat(market_trades);
|
|
56358
|
-
if (kind === "short") {
|
|
56359
|
-
}
|
|
56268
|
+
if (kind === "short") {}
|
|
56360
56269
|
if (this.minimum_size && total_orders.length > 0) {
|
|
56361
56270
|
let payload = total_orders;
|
|
56362
56271
|
let greater_than_min_size = total_orders.filter((o) => o ? o.quantity >= this.minimum_size : true);
|
|
@@ -56442,8 +56351,7 @@ class Signal {
|
|
|
56442
56351
|
});
|
|
56443
56352
|
const multiplier = start - index;
|
|
56444
56353
|
const incurred_fees = fees.reduce((a, b) => a + b, 0) + previous_risks.reduce((a, b) => a + b, 0);
|
|
56445
|
-
if (index === 0) {
|
|
56446
|
-
}
|
|
56354
|
+
if (index === 0) {}
|
|
56447
56355
|
let quantity = determine_position_size({
|
|
56448
56356
|
entry,
|
|
56449
56357
|
stop,
|
|
@@ -56829,8 +56737,7 @@ function buildConfig(app_config, {
|
|
|
56829
56737
|
return [];
|
|
56830
56738
|
}
|
|
56831
56739
|
const condition = (kind === "long" ? entry > app_config.support : entry >= app_config.support) && stop >= app_config.support * 0.999;
|
|
56832
|
-
if (kind === "short") {
|
|
56833
|
-
}
|
|
56740
|
+
if (kind === "short") {}
|
|
56834
56741
|
console.log({ entry, stop, condition, working_risk, config: config2 });
|
|
56835
56742
|
const result = entry === stop ? [] : condition ? instance.build_entry({
|
|
56836
56743
|
current_price: entry,
|
|
@@ -57867,6 +57774,31 @@ function constructAppConfig(payload) {
|
|
|
57867
57774
|
const appConfig = buildAppConfig(global_config, options);
|
|
57868
57775
|
return appConfig;
|
|
57869
57776
|
}
|
|
57777
|
+
function generateDangerousConfig(payload) {
|
|
57778
|
+
const { account, global_config, config: config2 } = payload;
|
|
57779
|
+
const app_config = constructAppConfig({
|
|
57780
|
+
account,
|
|
57781
|
+
global_config,
|
|
57782
|
+
kelly_config: {}
|
|
57783
|
+
});
|
|
57784
|
+
const { optimal_risk, optimal_stop } = getOptimumStopAndRisk(app_config, {
|
|
57785
|
+
max_size: config2.quantity,
|
|
57786
|
+
target_stop: config2.stop
|
|
57787
|
+
});
|
|
57788
|
+
const optimumRiskReward = computeRiskReward({
|
|
57789
|
+
app_config,
|
|
57790
|
+
entry: config2.entry,
|
|
57791
|
+
stop: optimal_stop,
|
|
57792
|
+
risk_per_trade: optimal_risk,
|
|
57793
|
+
target_loss: optimal_risk
|
|
57794
|
+
});
|
|
57795
|
+
return {
|
|
57796
|
+
entry: config2.entry,
|
|
57797
|
+
risk: optimal_risk,
|
|
57798
|
+
stop: optimal_stop,
|
|
57799
|
+
risk_reward: optimumRiskReward
|
|
57800
|
+
};
|
|
57801
|
+
}
|
|
57870
57802
|
// src/helpers/strategy.ts
|
|
57871
57803
|
class Strategy {
|
|
57872
57804
|
position;
|
|
@@ -58938,8 +58870,7 @@ async function createLimitPurchaseOrdersParallel(client, symbol, priceFormat, qu
|
|
|
58938
58870
|
const splitOrders = (inputOrders) => {
|
|
58939
58871
|
const result = [];
|
|
58940
58872
|
for (const o of inputOrders) {
|
|
58941
|
-
if (o.take_profit) {
|
|
58942
|
-
}
|
|
58873
|
+
if (o.take_profit) {}
|
|
58943
58874
|
if (o.stop && !o.side) {
|
|
58944
58875
|
result.push({
|
|
58945
58876
|
price: o.price,
|
|
@@ -59834,8 +59765,7 @@ async function createLimitPurchaseOrders(client, symbol, priceFormat, quantityFo
|
|
|
59834
59765
|
const splitOrders = (inputOrders) => {
|
|
59835
59766
|
const result = [];
|
|
59836
59767
|
for (const o of inputOrders) {
|
|
59837
|
-
if (o.take_profit) {
|
|
59838
|
-
}
|
|
59768
|
+
if (o.take_profit) {}
|
|
59839
59769
|
if (o.stop && !o.side) {
|
|
59840
59770
|
result.push({
|
|
59841
59771
|
price: o.price,
|
|
@@ -60387,10 +60317,8 @@ class BybitExchange extends BaseExchange {
|
|
|
60387
60317
|
sellLeverage: payload.leverage.toString()
|
|
60388
60318
|
});
|
|
60389
60319
|
}
|
|
60390
|
-
async generateConfig(payload) {
|
|
60391
|
-
}
|
|
60392
|
-
async checkDelistedMovers(payload) {
|
|
60393
|
-
}
|
|
60320
|
+
async generateConfig(payload) {}
|
|
60321
|
+
async checkDelistedMovers(payload) {}
|
|
60394
60322
|
async getAllOpenOrders() {
|
|
60395
60323
|
const result = await getAllOpenOrders2({ client: this.client });
|
|
60396
60324
|
return result;
|
|
@@ -60401,13 +60329,11 @@ class BybitExchange extends BaseExchange {
|
|
|
60401
60329
|
async getDelistedSpotSymbols() {
|
|
60402
60330
|
return [];
|
|
60403
60331
|
}
|
|
60404
|
-
async crossAccountTransfer(payload) {
|
|
60405
|
-
}
|
|
60332
|
+
async crossAccountTransfer(payload) {}
|
|
60406
60333
|
getOpenOrders(payload) {
|
|
60407
60334
|
return getOpenOrders2(this.client, payload.symbol);
|
|
60408
60335
|
}
|
|
60409
|
-
async placeBadStopEntry(payload) {
|
|
60410
|
-
}
|
|
60336
|
+
async placeBadStopEntry(payload) {}
|
|
60411
60337
|
}
|
|
60412
60338
|
|
|
60413
60339
|
// src/helpers/accounts.ts
|
|
@@ -60514,14 +60440,24 @@ function build_reduce_config(payload) {
|
|
|
60514
60440
|
} = payload;
|
|
60515
60441
|
const long_position = _positions.find((x) => x.kind === "long");
|
|
60516
60442
|
const short_position = _positions.find((x) => x.kind === "short");
|
|
60443
|
+
let long_target_pnl = long_position?.target_pnl || 0;
|
|
60444
|
+
let short_target_pnl = short_position?.target_pnl || 0;
|
|
60445
|
+
if (long_config.profit_percent && long_position?.entry) {
|
|
60446
|
+
const sell_price = (1 + long_config.profit_percent / 100) * long_position.entry;
|
|
60447
|
+
long_target_pnl = Math.abs(sell_price - long_position.entry) * long_position.quantity;
|
|
60448
|
+
}
|
|
60449
|
+
if (short_config.profit_percent && short_position?.entry) {
|
|
60450
|
+
const buy_price = (1 - short_config.profit_percent / 100) * short_position.entry;
|
|
60451
|
+
short_target_pnl = Math.abs(short_position.entry - buy_price) * short_position.quantity;
|
|
60452
|
+
}
|
|
60517
60453
|
return {
|
|
60518
60454
|
trigger_short: true,
|
|
60519
60455
|
trigger_long: true,
|
|
60520
60456
|
symbol,
|
|
60521
60457
|
short_minimum_pnl,
|
|
60522
60458
|
long_minimum_pnl,
|
|
60523
|
-
short_profit:
|
|
60524
|
-
long_profit:
|
|
60459
|
+
short_profit: short_target_pnl,
|
|
60460
|
+
long_profit: long_target_pnl,
|
|
60525
60461
|
owner: account.owner,
|
|
60526
60462
|
exchange: account.exchange,
|
|
60527
60463
|
not_reduce,
|
|
@@ -60838,6 +60774,10 @@ class ExchangePosition {
|
|
|
60838
60774
|
if (this.instance.expand.proxy) {
|
|
60839
60775
|
const result = this.instance.expand.proxy;
|
|
60840
60776
|
const { type, ip_address } = result;
|
|
60777
|
+
console.log("exchange", {
|
|
60778
|
+
owner: this.account.owner,
|
|
60779
|
+
exchange: this.account.exchange
|
|
60780
|
+
});
|
|
60841
60781
|
console.log("position", type, ip_address);
|
|
60842
60782
|
if (type === "http") {
|
|
60843
60783
|
return new import_https_proxy_agent2.HttpsProxyAgent(`http://${ip_address}`);
|
|
@@ -60876,7 +60816,7 @@ class ExchangePosition {
|
|
|
60876
60816
|
if (payload?.params) {
|
|
60877
60817
|
const db_position = this.instance;
|
|
60878
60818
|
if (db_position) {
|
|
60879
|
-
const config2 = db_position.expand?.
|
|
60819
|
+
const config2 = db_position.expand?.b_config;
|
|
60880
60820
|
const params = {
|
|
60881
60821
|
entry: payload.params.entry !== undefined ? payload.params.entry : config2?.entry,
|
|
60882
60822
|
stop: payload.params.stop !== undefined ? payload.params.stop : config2?.stop,
|
|
@@ -61257,7 +61197,6 @@ class ExchangePosition {
|
|
|
61257
61197
|
place
|
|
61258
61198
|
});
|
|
61259
61199
|
}
|
|
61260
|
-
const rr = await this.refresh(true);
|
|
61261
61200
|
await this.updateConfigPnl();
|
|
61262
61201
|
if (tp) {
|
|
61263
61202
|
await this.exchange_account.placeProfitAndStop({
|
|
@@ -61267,7 +61206,6 @@ class ExchangePosition {
|
|
|
61267
61206
|
});
|
|
61268
61207
|
}
|
|
61269
61208
|
return [];
|
|
61270
|
-
return rr.existingOrders;
|
|
61271
61209
|
}
|
|
61272
61210
|
async placeStopLimit(payload) {
|
|
61273
61211
|
const { place, stop, quantity: _quantity } = payload;
|
|
@@ -61741,14 +61679,29 @@ class ExchangePosition {
|
|
|
61741
61679
|
});
|
|
61742
61680
|
}
|
|
61743
61681
|
const last_order = focus_position.instance.last_order;
|
|
61744
|
-
|
|
61745
|
-
if (this.
|
|
61746
|
-
|
|
61747
|
-
|
|
61748
|
-
|
|
61749
|
-
|
|
61682
|
+
let take_profit;
|
|
61683
|
+
if (this.instance.tp?.price) {
|
|
61684
|
+
take_profit = to_f(this.instance.tp?.price, this.symbol_config.price_places);
|
|
61685
|
+
if (this.kind === "short" && last_order && take_profit) {
|
|
61686
|
+
const reduce_ratio = take_profit < last_order ? 1 : 0;
|
|
61687
|
+
await this.getConfig({
|
|
61688
|
+
params: {
|
|
61689
|
+
reduce_ratio
|
|
61690
|
+
}
|
|
61691
|
+
});
|
|
61692
|
+
}
|
|
61693
|
+
if (this.instance.quantity > 0) {
|
|
61694
|
+
if (focus_position.kind === "long" && focus_position.instance.stop_loss && take_profit > focus_position.appConfig.stop && focus_position.instance.stop_loss?.price) {
|
|
61695
|
+
await focus_position.cancelExchangeOrder({
|
|
61696
|
+
type: "stop"
|
|
61697
|
+
});
|
|
61750
61698
|
}
|
|
61751
|
-
|
|
61699
|
+
if (focus_position.kind === "short" && focus_position.instance.stop_loss && take_profit < focus_position.appConfig.stop && focus_position.instance.stop_loss?.price) {
|
|
61700
|
+
await focus_position.cancelExchangeOrder({
|
|
61701
|
+
type: "stop"
|
|
61702
|
+
});
|
|
61703
|
+
}
|
|
61704
|
+
}
|
|
61752
61705
|
}
|
|
61753
61706
|
return { profit_percent, take_profit, last_order };
|
|
61754
61707
|
}
|
|
@@ -61776,6 +61729,21 @@ class ExchangePosition {
|
|
|
61776
61729
|
}
|
|
61777
61730
|
return result;
|
|
61778
61731
|
}
|
|
61732
|
+
placeDangerousTrade(payload) {
|
|
61733
|
+
const { ...rest } = payload;
|
|
61734
|
+
const expected_quantity = rest.quantity;
|
|
61735
|
+
const entry = rest.entry;
|
|
61736
|
+
const stop = rest.stop;
|
|
61737
|
+
return generateDangerousConfig({
|
|
61738
|
+
account: this.instance,
|
|
61739
|
+
global_config: this.symbol_config,
|
|
61740
|
+
config: {
|
|
61741
|
+
entry,
|
|
61742
|
+
stop,
|
|
61743
|
+
quantity: expected_quantity
|
|
61744
|
+
}
|
|
61745
|
+
});
|
|
61746
|
+
}
|
|
61779
61747
|
}
|
|
61780
61748
|
function convert_to_exchange_order(order) {
|
|
61781
61749
|
return {
|
|
@@ -61841,8 +61809,7 @@ class ExchangeAccount {
|
|
|
61841
61809
|
async initializePositions(payload) {
|
|
61842
61810
|
const raw_positions = await this.syncAccount({
|
|
61843
61811
|
update: payload.update,
|
|
61844
|
-
symbol: payload.symbol
|
|
61845
|
-
live_refresh: payload.update
|
|
61812
|
+
symbol: payload.symbol
|
|
61846
61813
|
});
|
|
61847
61814
|
const positions = await this.syncAccount({
|
|
61848
61815
|
symbol: payload.symbol,
|
|
@@ -61854,6 +61821,7 @@ class ExchangeAccount {
|
|
|
61854
61821
|
const active_account = await this.getActiveAccount({
|
|
61855
61822
|
symbol: payload.symbol
|
|
61856
61823
|
});
|
|
61824
|
+
console.log("active_account", payload);
|
|
61857
61825
|
const long_position = positions.find((x) => x.kind === "long");
|
|
61858
61826
|
const short_position = positions.find((x) => x.kind === "short");
|
|
61859
61827
|
this.long_position = new ExchangePosition({
|
|
@@ -61929,6 +61897,9 @@ class ExchangeAccount {
|
|
|
61929
61897
|
});
|
|
61930
61898
|
if (options.kind) {
|
|
61931
61899
|
let position2 = db_positions2.find((x) => x.kind === options.kind);
|
|
61900
|
+
if (position2.symbol !== symbol) {
|
|
61901
|
+
throw new Error("Symbol mismatch");
|
|
61902
|
+
}
|
|
61932
61903
|
return position2;
|
|
61933
61904
|
}
|
|
61934
61905
|
return db_positions2;
|
|
@@ -61939,7 +61910,11 @@ class ExchangeAccount {
|
|
|
61939
61910
|
leverage: options.leverage
|
|
61940
61911
|
});
|
|
61941
61912
|
if (options.kind) {
|
|
61942
|
-
|
|
61913
|
+
const result = db_positions.find((x) => x.kind === options.kind);
|
|
61914
|
+
if (result.symbol !== symbol) {
|
|
61915
|
+
throw new Error("Symbol mismatch");
|
|
61916
|
+
}
|
|
61917
|
+
return result;
|
|
61943
61918
|
}
|
|
61944
61919
|
return db_positions;
|
|
61945
61920
|
}
|
|
@@ -61994,14 +61969,18 @@ class ExchangeAccount {
|
|
|
61994
61969
|
}
|
|
61995
61970
|
async getFocusPosition(payload) {
|
|
61996
61971
|
const { symbol, kind, update = false } = payload;
|
|
61972
|
+
console.log("payload", payload);
|
|
61997
61973
|
let focus_position = kind === "long" ? this.long_position : this.short_position;
|
|
61998
|
-
if (!focus_position) {
|
|
61974
|
+
if (!focus_position || focus_position.symbol !== symbol) {
|
|
61999
61975
|
focus_position = await this.initializePositions({
|
|
62000
61976
|
symbol,
|
|
62001
61977
|
kind,
|
|
62002
61978
|
update
|
|
62003
61979
|
});
|
|
62004
61980
|
}
|
|
61981
|
+
if (focus_position.symbol !== symbol) {
|
|
61982
|
+
throw new Error("Symbol mismatch");
|
|
61983
|
+
}
|
|
62005
61984
|
return focus_position;
|
|
62006
61985
|
}
|
|
62007
61986
|
async cancelOrders(payload) {
|
|
@@ -62120,7 +62099,10 @@ class ExchangeAccount {
|
|
|
62120
62099
|
return await focus_position.getOrCreatePositionConfig(payload);
|
|
62121
62100
|
}
|
|
62122
62101
|
async getPositionConfig(payload) {
|
|
62123
|
-
const focus_position = await this.getFocusPosition(
|
|
62102
|
+
const focus_position = await this.getFocusPosition({
|
|
62103
|
+
...payload,
|
|
62104
|
+
update: !Boolean(payload.params)
|
|
62105
|
+
});
|
|
62124
62106
|
return await focus_position.getConfig({
|
|
62125
62107
|
params: payload.params
|
|
62126
62108
|
});
|
|
@@ -62155,6 +62137,7 @@ class ExchangeAccount {
|
|
|
62155
62137
|
long_config,
|
|
62156
62138
|
short_config
|
|
62157
62139
|
});
|
|
62140
|
+
console.log("config", config2);
|
|
62158
62141
|
if (!long_config || !short_config) {
|
|
62159
62142
|
return null;
|
|
62160
62143
|
}
|
|
@@ -63197,10 +63180,19 @@ class ExchangeAccount {
|
|
|
63197
63180
|
const focus_position = await this.getFocusPosition(payload);
|
|
63198
63181
|
return await focus_position.placeStopLimit(payload);
|
|
63199
63182
|
}
|
|
63183
|
+
async placeDangerousTrade(payload) {
|
|
63184
|
+
const { symbol, config: config2, kind } = payload;
|
|
63185
|
+
const focus_position = await this.getFocusPosition({
|
|
63186
|
+
symbol,
|
|
63187
|
+
kind
|
|
63188
|
+
});
|
|
63189
|
+
return focus_position.placeDangerousTrade(config2);
|
|
63190
|
+
}
|
|
63200
63191
|
async placeTrade(payload) {
|
|
63201
63192
|
const focus_position = await this.getFocusPosition({
|
|
63202
63193
|
symbol: payload.symbol,
|
|
63203
|
-
kind: payload.kind
|
|
63194
|
+
kind: payload.kind,
|
|
63195
|
+
update: true
|
|
63204
63196
|
});
|
|
63205
63197
|
return await focus_position.placeTrade(payload);
|
|
63206
63198
|
}
|
|
@@ -63259,8 +63251,13 @@ class ExchangeAccount {
|
|
|
63259
63251
|
const opposite_config = focus_position.getOppositeConfig({
|
|
63260
63252
|
ratio: reward_factor
|
|
63261
63253
|
});
|
|
63254
|
+
console.log("opposite_config", opposite_config);
|
|
63262
63255
|
const reverse_config = await reversePosition.getConfig();
|
|
63263
|
-
|
|
63256
|
+
let condition = (reverse_config.entry !== opposite_config.entry || reverse_config.stop !== opposite_config.stop || reverse_config.risk !== opposite_config.risk || reverse_config.risk_reward !== opposite_config.risk_reward) && focus_position.getInstance().quantity > 0;
|
|
63257
|
+
if (reversePosition.getInstance().quantity === 0 && focus_position.getInstance().quantity > 0) {
|
|
63258
|
+
condition = true;
|
|
63259
|
+
}
|
|
63260
|
+
if (condition) {
|
|
63264
63261
|
console.log("Updating reverse config for ", symbol, kind, "with opposite config", opposite_config);
|
|
63265
63262
|
await reversePosition.getConfig({
|
|
63266
63263
|
params: {
|
|
@@ -63428,8 +63425,7 @@ class ExchangeAccount {
|
|
|
63428
63425
|
full_ratio
|
|
63429
63426
|
});
|
|
63430
63427
|
}
|
|
63431
|
-
async placeCompoundShortTrade(payload) {
|
|
63432
|
-
}
|
|
63428
|
+
async placeCompoundShortTrade(payload) {}
|
|
63433
63429
|
async placeCompoundLongTrade(payload) {
|
|
63434
63430
|
const { symbol, params, place = false } = payload;
|
|
63435
63431
|
if (place) {
|
|
@@ -64007,6 +64003,7 @@ export {
|
|
|
64007
64003
|
generateOptimumAppConfig,
|
|
64008
64004
|
generateOppositeTradeConfig,
|
|
64009
64005
|
generateGapTp,
|
|
64006
|
+
generateDangerousConfig,
|
|
64010
64007
|
exports_exchange_account as exchange_account,
|
|
64011
64008
|
determine_break_even_price,
|
|
64012
64009
|
determine_average_entry_and_size,
|