@alphafox/cli 0.3.23 → 0.3.24
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/engine-backtest/fetch-runtime.d.ts +1 -1
- package/dist/engine-backtest/fetch-runtime.js +13 -5
- package/dist/engine-backtest/run-command.js +1 -1
- package/dist/engine-backtest/sweep-command.js +1 -1
- package/dist/skills-manifest.json +38 -38
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/gcs-runtime-migration.md +7 -0
- package/package.json +1 -1
- package/skills/account/SKILL.md +1 -1
- package/skills/admin/SKILL.md +1 -1
- package/skills/alphafox/SKILL.md +1 -1
- package/skills/alphafox-shared/SKILL.md +1 -1
- package/skills/auth/SKILL.md +1 -1
- package/skills/cache/SKILL.md +1 -1
- package/skills/engine-backtest/SKILL.md +1 -1
- package/skills/exchange/SKILL.md +1 -1
- package/skills/market/SKILL.md +1 -1
- package/skills/notification/SKILL.md +1 -1
- package/skills/strategy/SKILL.md +1 -1
- package/skills/trading/SKILL.md +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const BACKTEST_RUNTIME_PROTOCOL = 1;
|
|
2
|
-
export declare const DEFAULT_BACKTEST_WASM_MANIFEST_URL = "https://
|
|
2
|
+
export declare const DEFAULT_BACKTEST_WASM_MANIFEST_URL = "https://api.alphafox.app/control-plane/v1/backtest/runtime-manifest";
|
|
3
3
|
export declare const BLOB_RUNTIME_FILES: {
|
|
4
4
|
readonly wasm: "tradingfox-backtest.wasm";
|
|
5
5
|
readonly wasmExec: "wasm_exec.js";
|
|
@@ -14,7 +14,7 @@ const node_stream_1 = require("node:stream");
|
|
|
14
14
|
const promises_2 = require("node:stream/promises");
|
|
15
15
|
const errors_1 = require("./errors");
|
|
16
16
|
exports.BACKTEST_RUNTIME_PROTOCOL = 1;
|
|
17
|
-
exports.DEFAULT_BACKTEST_WASM_MANIFEST_URL = "https://
|
|
17
|
+
exports.DEFAULT_BACKTEST_WASM_MANIFEST_URL = "https://api.alphafox.app/control-plane/v1/backtest/runtime-manifest";
|
|
18
18
|
exports.BLOB_RUNTIME_FILES = {
|
|
19
19
|
wasm: "tradingfox-backtest.wasm",
|
|
20
20
|
wasmExec: "wasm_exec.js",
|
|
@@ -38,8 +38,16 @@ const HASHED_BLOB_RUNTIME_FILES = [
|
|
|
38
38
|
exports.BLOB_RUNTIME_FILES.nodeWorkerPath,
|
|
39
39
|
];
|
|
40
40
|
function resolveBacktestWasmManifestUrl(env = process.env) {
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
const override = env.ALPHAFOX_BACKTEST_WASM_MANIFEST_URL?.trim();
|
|
42
|
+
if (override)
|
|
43
|
+
return override;
|
|
44
|
+
if (env.ALPHAFOX_PROFILE === "staging") {
|
|
45
|
+
return "https://staging-api.alphafox.app/control-plane/v1/backtest/runtime-manifest";
|
|
46
|
+
}
|
|
47
|
+
if (env.ALPHAFOX_PROFILE === "local") {
|
|
48
|
+
throw new errors_1.EngineBacktestError({ type: "runtime", subtype: "runtime_manifest_unconfigured", message: "Local profile requires ALPHAFOX_BACKTEST_WASM_MANIFEST_URL or an explicit local Engine build." });
|
|
49
|
+
}
|
|
50
|
+
return exports.DEFAULT_BACKTEST_WASM_MANIFEST_URL;
|
|
43
51
|
}
|
|
44
52
|
function resolveRuntimeCacheDir(hash, env = process.env) {
|
|
45
53
|
const override = env.ALPHAFOX_BACKTEST_RUNTIME_CACHE_DIR?.trim();
|
|
@@ -104,7 +112,7 @@ async function ensureBlobRuntime(env = process.env, hooks) {
|
|
|
104
112
|
type: "runtime",
|
|
105
113
|
subtype: "runtime_manifest_unavailable",
|
|
106
114
|
message: `Cannot load backtest runtime manifest: ${error instanceof Error ? error.message : String(error)}`,
|
|
107
|
-
hint: "Check network access to
|
|
115
|
+
hint: "Check network access to the Engine runtime discovery API, or set ALPHAFOX_USE_LOCAL_BACKTEST=1 with a local Engine build.",
|
|
108
116
|
details: { manifestUrl },
|
|
109
117
|
});
|
|
110
118
|
}
|
|
@@ -113,7 +121,7 @@ async function ensureBlobRuntime(env = process.env, hooks) {
|
|
|
113
121
|
type: "runtime",
|
|
114
122
|
subtype: "runtime_manifest_unavailable",
|
|
115
123
|
message: `Backtest runtime manifest unavailable (HTTP ${response.status}).`,
|
|
116
|
-
hint: "Check network access to
|
|
124
|
+
hint: "Check network access to the Engine runtime discovery API, or set ALPHAFOX_USE_LOCAL_BACKTEST=1 with a local Engine build.",
|
|
117
125
|
details: { manifestUrl, status: response.status },
|
|
118
126
|
});
|
|
119
127
|
}
|
|
@@ -216,7 +216,7 @@ async function executeEngineBacktestRun(args, flags, env = process.env, deps = {
|
|
|
216
216
|
}
|
|
217
217
|
else {
|
|
218
218
|
const [wasmLoaded, runnerLoaded] = await Promise.all([
|
|
219
|
-
(0, resolve_packages_1.loadBacktestWasm)(env, deps.resolveHooks),
|
|
219
|
+
(0, resolve_packages_1.loadBacktestWasm)({ ...env, ALPHAFOX_PROFILE: profile.name }, deps.resolveHooks),
|
|
220
220
|
(0, resolve_packages_1.loadBacktestRunner)(env, deps.resolveHooks),
|
|
221
221
|
]);
|
|
222
222
|
wasm = wasmLoaded.module;
|
|
@@ -82,7 +82,7 @@ async function executeEngineBacktestSweep(args, flags, env = process.env, deps =
|
|
|
82
82
|
cwd: deps.cwd,
|
|
83
83
|
readFile: deps.readFile,
|
|
84
84
|
}), config, args.mode);
|
|
85
|
-
const { wasm, runner } = await loadRuntime(deps, env);
|
|
85
|
+
const { wasm, runner } = await loadRuntime(deps, { ...env, ALPHAFOX_PROFILE: profile.name });
|
|
86
86
|
const clients = [];
|
|
87
87
|
try {
|
|
88
88
|
const client = wasm.createNodeBacktestClient({ verbose: args.verbose });
|
|
@@ -1,153 +1,153 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"packageName": "@alphafox/cli",
|
|
4
|
-
"packageVersion": "0.3.
|
|
4
|
+
"packageVersion": "0.3.24",
|
|
5
5
|
"contractVersion": "2026-08-31",
|
|
6
|
-
"bundleHash": "
|
|
6
|
+
"bundleHash": "268fe5f1673a98d317f50887066cbdc4b9a2663ad3d8d4d1ef2264542c469d4b",
|
|
7
7
|
"skills": [
|
|
8
8
|
{
|
|
9
9
|
"name": "alphafox",
|
|
10
|
-
"version": "0.3.
|
|
10
|
+
"version": "0.3.24",
|
|
11
11
|
"files": [
|
|
12
12
|
{
|
|
13
13
|
"path": "SKILL.md",
|
|
14
|
-
"sha256": "
|
|
14
|
+
"sha256": "580e26102a42d2871d1876832b542411f4aa6dd68dafa29c1a30e520c55b1e41",
|
|
15
15
|
"size": 6711
|
|
16
16
|
}
|
|
17
17
|
],
|
|
18
|
-
"hash": "
|
|
18
|
+
"hash": "5e62600962da6d22119d06a4bd3076780ea99aeb6ec3a64e9e6b278fc42f8c74"
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
"name": "alphafox-account",
|
|
22
|
-
"version": "0.3.
|
|
22
|
+
"version": "0.3.24",
|
|
23
23
|
"files": [
|
|
24
24
|
{
|
|
25
25
|
"path": "SKILL.md",
|
|
26
|
-
"sha256": "
|
|
26
|
+
"sha256": "b6bb1b5c3d9f7a147981a22f036f7c15cfabfdab9159ed6185d83fb5565ff22a",
|
|
27
27
|
"size": 784
|
|
28
28
|
}
|
|
29
29
|
],
|
|
30
|
-
"hash": "
|
|
30
|
+
"hash": "17d7afff57d90861b1623ebadebed3a6ca7f6f45bcf81158df59c1ec2a84f8b1"
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
"name": "alphafox-admin",
|
|
34
|
-
"version": "0.3.
|
|
34
|
+
"version": "0.3.24",
|
|
35
35
|
"files": [
|
|
36
36
|
{
|
|
37
37
|
"path": "SKILL.md",
|
|
38
|
-
"sha256": "
|
|
38
|
+
"sha256": "8de45c0ee0947c57afd17d719bdf5737e260d0beb535b23aab546b74b160e439",
|
|
39
39
|
"size": 2078
|
|
40
40
|
}
|
|
41
41
|
],
|
|
42
|
-
"hash": "
|
|
42
|
+
"hash": "28149c13321f3216fff2a6448c6004b666c4ec3b28142b4769cad2d012e8f65f"
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
"name": "alphafox-auth",
|
|
46
|
-
"version": "0.3.
|
|
46
|
+
"version": "0.3.24",
|
|
47
47
|
"files": [
|
|
48
48
|
{
|
|
49
49
|
"path": "SKILL.md",
|
|
50
|
-
"sha256": "
|
|
50
|
+
"sha256": "b6fef448fdc874516a3e8e9d63c0d37084a1b14141c02068fb9a4dd7a0f175f0",
|
|
51
51
|
"size": 2371
|
|
52
52
|
}
|
|
53
53
|
],
|
|
54
|
-
"hash": "
|
|
54
|
+
"hash": "0307804078457f61d6e759025e4fe7a9177263199c2a0655b2db0b1c3859ab8c"
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
"name": "alphafox-cache",
|
|
58
|
-
"version": "0.3.
|
|
58
|
+
"version": "0.3.24",
|
|
59
59
|
"files": [
|
|
60
60
|
{
|
|
61
61
|
"path": "SKILL.md",
|
|
62
|
-
"sha256": "
|
|
62
|
+
"sha256": "1542a43cf58338c4ad8b238cb81e672fd06741c5c4d5574907685cec1465c29a",
|
|
63
63
|
"size": 1762
|
|
64
64
|
}
|
|
65
65
|
],
|
|
66
|
-
"hash": "
|
|
66
|
+
"hash": "38f55adfe15d90e1f700b01434e10315cd21a2eaf68aa81ef1cbaa6838239ae8"
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
69
|
"name": "alphafox-engine-backtest",
|
|
70
|
-
"version": "0.3.
|
|
70
|
+
"version": "0.3.24",
|
|
71
71
|
"files": [
|
|
72
72
|
{
|
|
73
73
|
"path": "SKILL.md",
|
|
74
|
-
"sha256": "
|
|
74
|
+
"sha256": "63d100f1312b37905a1e0483102f0717f5a7ce4774b45c293e691cde951417e4",
|
|
75
75
|
"size": 9862
|
|
76
76
|
}
|
|
77
77
|
],
|
|
78
|
-
"hash": "
|
|
78
|
+
"hash": "5f76ddce28123600785ee2bfe4e512b92c191ff9b031f721ca42d32b7644c07f"
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
81
|
"name": "alphafox-exchange",
|
|
82
|
-
"version": "0.3.
|
|
82
|
+
"version": "0.3.24",
|
|
83
83
|
"files": [
|
|
84
84
|
{
|
|
85
85
|
"path": "SKILL.md",
|
|
86
|
-
"sha256": "
|
|
86
|
+
"sha256": "82d13d7541314c13244dad557d11b28815e4dabc7a4982390d16cb4e6eae6180",
|
|
87
87
|
"size": 744
|
|
88
88
|
}
|
|
89
89
|
],
|
|
90
|
-
"hash": "
|
|
90
|
+
"hash": "cd917932104e318c8a65f0f16adea15e5c7af682bd37814a06de436cbc01fdbe"
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
93
|
"name": "alphafox-market",
|
|
94
|
-
"version": "0.3.
|
|
94
|
+
"version": "0.3.24",
|
|
95
95
|
"files": [
|
|
96
96
|
{
|
|
97
97
|
"path": "SKILL.md",
|
|
98
|
-
"sha256": "
|
|
98
|
+
"sha256": "b6ff2ee7956b997f89baa8043bf30c3bf0581cae202a10639acfe5eb01e97513",
|
|
99
99
|
"size": 3208
|
|
100
100
|
}
|
|
101
101
|
],
|
|
102
|
-
"hash": "
|
|
102
|
+
"hash": "67f726874447e1b697397bafaa2a42cc5bf271bcf5d0b981ce98acee77924f03"
|
|
103
103
|
},
|
|
104
104
|
{
|
|
105
105
|
"name": "alphafox-notification",
|
|
106
|
-
"version": "0.3.
|
|
106
|
+
"version": "0.3.24",
|
|
107
107
|
"files": [
|
|
108
108
|
{
|
|
109
109
|
"path": "SKILL.md",
|
|
110
|
-
"sha256": "
|
|
110
|
+
"sha256": "bae0d88305ee82867798d969fe39ea7420436b02cfb37dc4837d55143e2c4e83",
|
|
111
111
|
"size": 699
|
|
112
112
|
}
|
|
113
113
|
],
|
|
114
|
-
"hash": "
|
|
114
|
+
"hash": "8a6e3af0edee2f3e30a5326333c7918c863da194ee6086a92ccc71d8fa057924"
|
|
115
115
|
},
|
|
116
116
|
{
|
|
117
117
|
"name": "alphafox-shared",
|
|
118
|
-
"version": "0.3.
|
|
118
|
+
"version": "0.3.24",
|
|
119
119
|
"files": [
|
|
120
120
|
{
|
|
121
121
|
"path": "SKILL.md",
|
|
122
|
-
"sha256": "
|
|
122
|
+
"sha256": "4fda905ccf93ae321e36de4bc41dd7508825c7073bbbd237fc5b82910094ff70",
|
|
123
123
|
"size": 7819
|
|
124
124
|
}
|
|
125
125
|
],
|
|
126
|
-
"hash": "
|
|
126
|
+
"hash": "b610b7f938899ce1d6327bac9a4f5788e72bedb2a033ac77cadf8ea7d0a050b5"
|
|
127
127
|
},
|
|
128
128
|
{
|
|
129
129
|
"name": "alphafox-strategy",
|
|
130
|
-
"version": "0.3.
|
|
130
|
+
"version": "0.3.24",
|
|
131
131
|
"files": [
|
|
132
132
|
{
|
|
133
133
|
"path": "SKILL.md",
|
|
134
|
-
"sha256": "
|
|
134
|
+
"sha256": "b1caecced015cb227842153660744470a1092e823d2b355570c7e396ee3c9c5d",
|
|
135
135
|
"size": 8039
|
|
136
136
|
}
|
|
137
137
|
],
|
|
138
|
-
"hash": "
|
|
138
|
+
"hash": "57df3973cfcae8accccb5d65f16efd1fa0cde6d670f03ee318077db1d57c4e03"
|
|
139
139
|
},
|
|
140
140
|
{
|
|
141
141
|
"name": "alphafox-trading",
|
|
142
|
-
"version": "0.3.
|
|
142
|
+
"version": "0.3.24",
|
|
143
143
|
"files": [
|
|
144
144
|
{
|
|
145
145
|
"path": "SKILL.md",
|
|
146
|
-
"sha256": "
|
|
146
|
+
"sha256": "ba28488c9a46ea5da006940603580a05811939d9a6abbc4f14be69d315c04b2a",
|
|
147
147
|
"size": 4920
|
|
148
148
|
}
|
|
149
149
|
],
|
|
150
|
-
"hash": "
|
|
150
|
+
"hash": "a7bb8403c0a9c7e42658e85770ec1451705d5bd7a4d5283847dab667b021e50e"
|
|
151
151
|
}
|
|
152
152
|
]
|
|
153
153
|
}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const CLI_NAME = "alphafox";
|
|
2
2
|
export declare const CLI_PACKAGE = "@alphafox/cli";
|
|
3
|
-
export declare const CLI_VERSION = "0.3.
|
|
3
|
+
export declare const CLI_VERSION = "0.3.24";
|
|
4
4
|
export { CATALOG_VERSION as CLI_CONTRACT_VERSION } from "./catalog/operations";
|
package/dist/version.js
CHANGED
|
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CLI_CONTRACT_VERSION = exports.CLI_VERSION = exports.CLI_PACKAGE = exports.CLI_NAME = void 0;
|
|
4
4
|
exports.CLI_NAME = "alphafox";
|
|
5
5
|
exports.CLI_PACKAGE = "@alphafox/cli";
|
|
6
|
-
exports.CLI_VERSION = "0.3.
|
|
6
|
+
exports.CLI_VERSION = "0.3.24";
|
|
7
7
|
var operations_1 = require("./catalog/operations");
|
|
8
8
|
Object.defineProperty(exports, "CLI_CONTRACT_VERSION", { enumerable: true, get: function () { return operations_1.CATALOG_VERSION; } });
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Runtime discovery migration
|
|
2
|
+
|
|
3
|
+
New CLI releases discover the protocol-1 runtime through the environment's Engine API and download the same nine files from GCS / Cloud CDN. SHA256 runtime verification and the existing content cache remain enabled. `--profile staging` selects staging; production selects production. A local profile requires an explicit manifest URL or local runtime build.
|
|
4
|
+
|
|
5
|
+
`ALPHAFOX_BACKTEST_WASM_MANIFEST_URL` remains an explicit override. Discovery errors are reported; no automatic switch to the old Blob URL occurs.
|
|
6
|
+
|
|
7
|
+
Historical packages keep their original Blob endpoint and frozen compatible files. The support end date is not yet defined; do not delete them based on a short period of low traffic. Upgrade with `npm install -g @alphafox/cli` after the new release has been published. A PR is not an npm release.
|
package/package.json
CHANGED
package/skills/account/SKILL.md
CHANGED
package/skills/admin/SKILL.md
CHANGED
package/skills/alphafox/SKILL.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: alphafox
|
|
3
3
|
description: "Route AlphaFox product CLI requests: installation/auth, market data, strategy configuration, backtests, traders, connectors, accounts and notifications. Repository development or AGENTS/Skills maintenance uses repository instructions, not product CLI operations."
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.24
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# AlphaFox
|
package/skills/auth/SKILL.md
CHANGED
package/skills/cache/SKILL.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: alphafox-engine-backtest
|
|
3
3
|
description: Local Engine WASM backtest (alphafox engine-backtest run|sweep) vs catalog experiment CRUD. After a persisted run, include https://www.alphafox.app/zh/dashboard/traders/backtest/{experimentId}.
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.24
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Engine Backtest
|
package/skills/exchange/SKILL.md
CHANGED
package/skills/market/SKILL.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: alphafox-market
|
|
3
3
|
description: Market data and ticker resolution for US equity perps, RWAs, and crypto on the same perp catalog. Use when the user names 美股, NVDA, AAPL, BTC, or any 标的. Keep the operator's asset class via symbolMetadata — do not rewrite NVDA into a crypto coin.
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.24
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Market
|
package/skills/strategy/SKILL.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: alphafox-strategy
|
|
3
3
|
description: Strategy definitions — list types, read a definition's contract, and validate config. Creating a running strategy is creating a trader; use alphafox-trading for that. Local Engine backtest is alphafox-engine-backtest.
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.24
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Strategy definitions
|
package/skills/trading/SKILL.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: alphafox-trading
|
|
3
3
|
description: Running strategies (traders) — create, list, start, and stop. A trader is a live or paper strategy instance (grid, dca, copy, …), not a person. Default Engine create uses autoStart true (创建即开始). Use autoStart false only when the user asks to create without starting. After create or start, include https://www.alphafox.app/zh/dashboard/traders/{traderId}.
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.24
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Running strategies (traders)
|