@tradejs/cli 3.1.29-beta.291 → 3.1.29-beta.296
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/cli.js +7150 -6352
- package/dist/lib/binanceMarketContextBackfill.js +2 -2
- package/dist/lib/coinMarketCapContextBackfill.js +1 -1
- package/dist/lib/coreResearch.js +261 -115
- package/dist/lib/marketContextPrepare.js +3 -3
- package/dist/lib/researchVisuals.js +27 -6
- package/dist/lib/strategyResearch.js +234 -245
- package/dist/scripts/aiPocketSearch.js +3343 -3029
- package/dist/scripts/backtest.js +192 -69
- package/dist/scripts/binanceMarketIngest.js +3 -3
- package/dist/scripts/coreResearch.js +263 -115
- package/dist/scripts/replay.js +483 -114
- package/dist/scripts/replayRunner.js +483 -114
- package/dist/scripts/researchVisuals.js +27 -6
- package/dist/scripts/runtimeParity.js +3 -3
- package/dist/scripts/signals.js +3 -3
- package/dist/scripts/signalsDaemon.js +3 -3
- package/dist/scripts/strategyRelease.js +6 -37
- package/dist/scripts/strategyResearch.js +239 -249
- package/package.json +7 -7
- package/dist/lib/researchMetricSnapshot.js +0 -74
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tradejs/cli",
|
|
3
|
-
"version": "3.1.29-beta.
|
|
3
|
+
"version": "3.1.29-beta.296",
|
|
4
4
|
"description": "Official CLI for the TradeJS TypeScript framework: infra setup, backtests, signals, bots, and ML workflows.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tradejs",
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
"tradejs": "dist/cli.js"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@tradejs/connectors": "^3.1.29-beta.
|
|
41
|
-
"@tradejs/core": "^3.1.29-beta.
|
|
42
|
-
"@tradejs/indicators": "^3.1.29-beta.
|
|
43
|
-
"@tradejs/infra": "^3.1.29-beta.
|
|
44
|
-
"@tradejs/node": "^3.1.29-beta.
|
|
40
|
+
"@tradejs/connectors": "^3.1.29-beta.296",
|
|
41
|
+
"@tradejs/core": "^3.1.29-beta.296",
|
|
42
|
+
"@tradejs/indicators": "^3.1.29-beta.296",
|
|
43
|
+
"@tradejs/infra": "^3.1.29-beta.296",
|
|
44
|
+
"@tradejs/node": "^3.1.29-beta.296",
|
|
45
45
|
"@tradejs/strategy-kit": "3.0.6",
|
|
46
|
-
"@tradejs/types": "^3.1.29-beta.
|
|
46
|
+
"@tradejs/types": "^3.1.29-beta.296",
|
|
47
47
|
"args": "^5.0.3",
|
|
48
48
|
"bcryptjs": "^2.4.3",
|
|
49
49
|
"chalk": "4.1.2",
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/lib/researchMetricSnapshot.ts
|
|
21
|
-
var researchMetricSnapshot_exports = {};
|
|
22
|
-
__export(researchMetricSnapshot_exports, {
|
|
23
|
-
decodeResearchMetricSnapshot: () => decodeResearchMetricSnapshot,
|
|
24
|
-
encodeResearchMetricSnapshot: () => encodeResearchMetricSnapshot,
|
|
25
|
-
validatePermanentResearchMetrics: () => validatePermanentResearchMetrics
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(researchMetricSnapshot_exports);
|
|
28
|
-
var import_node_crypto = require("crypto");
|
|
29
|
-
var import_node_zlib = require("zlib");
|
|
30
|
-
var MAX_BYTES = 256 * 1024 * 1024;
|
|
31
|
-
var hash = (bytes) => (0, import_node_crypto.createHash)("sha256").update(bytes).digest("hex");
|
|
32
|
-
var validatePermanentResearchMetrics = (value) => {
|
|
33
|
-
if (!value || typeof value !== "object") return;
|
|
34
|
-
for (const [key, child] of Object.entries(value)) {
|
|
35
|
-
if (["matchedPairs", "tradeRows", "allProjectedLeaves"].includes(key) && Array.isArray(child) && child.length)
|
|
36
|
-
throw new Error(`Temporary payload ${key} is not a permanent metric`);
|
|
37
|
-
if (key === "trades" && Array.isArray(child) && child.some(
|
|
38
|
-
(row) => row && typeof row === "object" && ("signalId" in row || "entryTimestamp" in row)
|
|
39
|
-
))
|
|
40
|
-
throw new Error("Temporary trade records are not permanent metrics");
|
|
41
|
-
validatePermanentResearchMetrics(child);
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
var encodeResearchMetricSnapshot = (metrics) => {
|
|
45
|
-
validatePermanentResearchMetrics(metrics);
|
|
46
|
-
const bytes = Buffer.from(JSON.stringify(metrics));
|
|
47
|
-
if (bytes.length > MAX_BYTES)
|
|
48
|
-
throw new Error("Metric snapshot exceeds decoded size limit");
|
|
49
|
-
return {
|
|
50
|
-
schema: "tradejs-metric-snapshot/v1",
|
|
51
|
-
encoding: "gzip+base64",
|
|
52
|
-
decodedBytes: bytes.length,
|
|
53
|
-
sha256: hash(bytes),
|
|
54
|
-
payload: (0, import_node_zlib.gzipSync)(bytes, { level: 9 }).toString("base64")
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
var decodeResearchMetricSnapshot = (snapshot) => {
|
|
58
|
-
if (!snapshot || typeof snapshot !== "object" || !("schema" in snapshot) || snapshot.schema !== "tradejs-metric-snapshot/v1" || !("encoding" in snapshot) || snapshot.encoding !== "gzip+base64" || !("decodedBytes" in snapshot) || typeof snapshot.decodedBytes !== "number" || !Number.isSafeInteger(snapshot.decodedBytes) || snapshot.decodedBytes <= 0 || snapshot.decodedBytes > MAX_BYTES || !("sha256" in snapshot) || typeof snapshot.sha256 !== "string" || !/^[a-f0-9]{64}$/.test(snapshot.sha256) || !("payload" in snapshot) || typeof snapshot.payload !== "string")
|
|
59
|
-
throw new Error("Invalid metric snapshot envelope");
|
|
60
|
-
const bytes = (0, import_node_zlib.gunzipSync)(Buffer.from(snapshot.payload, "base64"), {
|
|
61
|
-
maxOutputLength: snapshot.decodedBytes
|
|
62
|
-
});
|
|
63
|
-
if (bytes.length !== snapshot.decodedBytes || hash(bytes) !== snapshot.sha256)
|
|
64
|
-
throw new Error("Metric snapshot checksum or size mismatch");
|
|
65
|
-
const metrics = JSON.parse(bytes.toString("utf8"));
|
|
66
|
-
validatePermanentResearchMetrics(metrics);
|
|
67
|
-
return metrics;
|
|
68
|
-
};
|
|
69
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
70
|
-
0 && (module.exports = {
|
|
71
|
-
decodeResearchMetricSnapshot,
|
|
72
|
-
encodeResearchMetricSnapshot,
|
|
73
|
-
validatePermanentResearchMetrics
|
|
74
|
-
});
|