@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.
@@ -1,5 +1,5 @@
1
1
  export declare const BACKTEST_RUNTIME_PROTOCOL = 1;
2
- export declare const DEFAULT_BACKTEST_WASM_MANIFEST_URL = "https://zwggllrrna54e2d6.public.blob.vercel-storage.com/engine-backtest/latest.json";
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://zwggllrrna54e2d6.public.blob.vercel-storage.com/engine-backtest/latest.json";
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
- return (env.ALPHAFOX_BACKTEST_WASM_MANIFEST_URL?.trim() ||
42
- exports.DEFAULT_BACKTEST_WASM_MANIFEST_URL);
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 Vercel Blob, or set ALPHAFOX_USE_LOCAL_BACKTEST=1 with a local Engine build.",
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 Vercel Blob, or set ALPHAFOX_USE_LOCAL_BACKTEST=1 with a local Engine build.",
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.23",
4
+ "packageVersion": "0.3.24",
5
5
  "contractVersion": "2026-08-31",
6
- "bundleHash": "cefb5f2b4c977a754941282a46780e64143978f21d4ad1db4da9fed993455094",
6
+ "bundleHash": "268fe5f1673a98d317f50887066cbdc4b9a2663ad3d8d4d1ef2264542c469d4b",
7
7
  "skills": [
8
8
  {
9
9
  "name": "alphafox",
10
- "version": "0.3.23",
10
+ "version": "0.3.24",
11
11
  "files": [
12
12
  {
13
13
  "path": "SKILL.md",
14
- "sha256": "ad970465cc7a8b6db68253cd6c6b375e824c32c197bd10cdd4735052a9dc54e6",
14
+ "sha256": "580e26102a42d2871d1876832b542411f4aa6dd68dafa29c1a30e520c55b1e41",
15
15
  "size": 6711
16
16
  }
17
17
  ],
18
- "hash": "57b1b2996a4cb8e22ee36ccacae56ff36bcd64ac7203e528ccbca4b898f39a07"
18
+ "hash": "5e62600962da6d22119d06a4bd3076780ea99aeb6ec3a64e9e6b278fc42f8c74"
19
19
  },
20
20
  {
21
21
  "name": "alphafox-account",
22
- "version": "0.3.23",
22
+ "version": "0.3.24",
23
23
  "files": [
24
24
  {
25
25
  "path": "SKILL.md",
26
- "sha256": "23a35e3a3d6ac9e7da639b9383750f66e9de4dbbe049861da78f7912e9076512",
26
+ "sha256": "b6bb1b5c3d9f7a147981a22f036f7c15cfabfdab9159ed6185d83fb5565ff22a",
27
27
  "size": 784
28
28
  }
29
29
  ],
30
- "hash": "9b604ef9fc3c097333cf55b5e5fadb4c0179ad15c0dc05b3f76805abb4179be3"
30
+ "hash": "17d7afff57d90861b1623ebadebed3a6ca7f6f45bcf81158df59c1ec2a84f8b1"
31
31
  },
32
32
  {
33
33
  "name": "alphafox-admin",
34
- "version": "0.3.23",
34
+ "version": "0.3.24",
35
35
  "files": [
36
36
  {
37
37
  "path": "SKILL.md",
38
- "sha256": "d53090a8e0ac05b5d8d753d52086389ed0ee0f9d405c3adfb120d06d3a17841e",
38
+ "sha256": "8de45c0ee0947c57afd17d719bdf5737e260d0beb535b23aab546b74b160e439",
39
39
  "size": 2078
40
40
  }
41
41
  ],
42
- "hash": "f8c047c2c4f1a49c13d5fe92c1676108fe31bcfdb3eebfb49fbe7719586944bb"
42
+ "hash": "28149c13321f3216fff2a6448c6004b666c4ec3b28142b4769cad2d012e8f65f"
43
43
  },
44
44
  {
45
45
  "name": "alphafox-auth",
46
- "version": "0.3.23",
46
+ "version": "0.3.24",
47
47
  "files": [
48
48
  {
49
49
  "path": "SKILL.md",
50
- "sha256": "a563b8c330fcee564b9dae3ab177b36e6612a5e6e28c0dcc2770ebe699f45181",
50
+ "sha256": "b6fef448fdc874516a3e8e9d63c0d37084a1b14141c02068fb9a4dd7a0f175f0",
51
51
  "size": 2371
52
52
  }
53
53
  ],
54
- "hash": "f6e8ac98bca895fb0e5afb0f7f915645267404aa77cc85724475287866619d68"
54
+ "hash": "0307804078457f61d6e759025e4fe7a9177263199c2a0655b2db0b1c3859ab8c"
55
55
  },
56
56
  {
57
57
  "name": "alphafox-cache",
58
- "version": "0.3.23",
58
+ "version": "0.3.24",
59
59
  "files": [
60
60
  {
61
61
  "path": "SKILL.md",
62
- "sha256": "9858b145e37f91082af9f9ed07d7f89c63f51365de3e1d04925b4bf476fe11c9",
62
+ "sha256": "1542a43cf58338c4ad8b238cb81e672fd06741c5c4d5574907685cec1465c29a",
63
63
  "size": 1762
64
64
  }
65
65
  ],
66
- "hash": "dd38538eb6a66500361406acba11818ef333c50c119735f8dc4e846d20aaee51"
66
+ "hash": "38f55adfe15d90e1f700b01434e10315cd21a2eaf68aa81ef1cbaa6838239ae8"
67
67
  },
68
68
  {
69
69
  "name": "alphafox-engine-backtest",
70
- "version": "0.3.23",
70
+ "version": "0.3.24",
71
71
  "files": [
72
72
  {
73
73
  "path": "SKILL.md",
74
- "sha256": "feded42f5db1201ea13dca0fdcff0eb8a210024440b9e253f6b2b213065f45bb",
74
+ "sha256": "63d100f1312b37905a1e0483102f0717f5a7ce4774b45c293e691cde951417e4",
75
75
  "size": 9862
76
76
  }
77
77
  ],
78
- "hash": "9071605d37c982f7741fe533671fb10d97d17d0265db0712d8b784f4562334ad"
78
+ "hash": "5f76ddce28123600785ee2bfe4e512b92c191ff9b031f721ca42d32b7644c07f"
79
79
  },
80
80
  {
81
81
  "name": "alphafox-exchange",
82
- "version": "0.3.23",
82
+ "version": "0.3.24",
83
83
  "files": [
84
84
  {
85
85
  "path": "SKILL.md",
86
- "sha256": "ed25e4487435552e7d2fb647a7c4ab0dcd96c11e65f6fd0076e841095497a412",
86
+ "sha256": "82d13d7541314c13244dad557d11b28815e4dabc7a4982390d16cb4e6eae6180",
87
87
  "size": 744
88
88
  }
89
89
  ],
90
- "hash": "9dcbabf7b94c11901b35f3cf9f2f980a718ce675534df44e406ef0fb4ace9082"
90
+ "hash": "cd917932104e318c8a65f0f16adea15e5c7af682bd37814a06de436cbc01fdbe"
91
91
  },
92
92
  {
93
93
  "name": "alphafox-market",
94
- "version": "0.3.23",
94
+ "version": "0.3.24",
95
95
  "files": [
96
96
  {
97
97
  "path": "SKILL.md",
98
- "sha256": "3e5835e3d4d658b43265ecb2d062bf2440e8f76f112104b0e66d4ee4a4362738",
98
+ "sha256": "b6ff2ee7956b997f89baa8043bf30c3bf0581cae202a10639acfe5eb01e97513",
99
99
  "size": 3208
100
100
  }
101
101
  ],
102
- "hash": "ff13c2cf880c6a7e0a8c20da2fffcdfc32f05737e1d860c3d76c3b1883a70d9d"
102
+ "hash": "67f726874447e1b697397bafaa2a42cc5bf271bcf5d0b981ce98acee77924f03"
103
103
  },
104
104
  {
105
105
  "name": "alphafox-notification",
106
- "version": "0.3.23",
106
+ "version": "0.3.24",
107
107
  "files": [
108
108
  {
109
109
  "path": "SKILL.md",
110
- "sha256": "684c29d65ef408836fe6841d272ac9c3cbf725ee9763deb886fad2e1076c07a2",
110
+ "sha256": "bae0d88305ee82867798d969fe39ea7420436b02cfb37dc4837d55143e2c4e83",
111
111
  "size": 699
112
112
  }
113
113
  ],
114
- "hash": "318099f64c6952496f21a7046723e4c5c9edfedb2f2687930cb5b80678ae22db"
114
+ "hash": "8a6e3af0edee2f3e30a5326333c7918c863da194ee6086a92ccc71d8fa057924"
115
115
  },
116
116
  {
117
117
  "name": "alphafox-shared",
118
- "version": "0.3.23",
118
+ "version": "0.3.24",
119
119
  "files": [
120
120
  {
121
121
  "path": "SKILL.md",
122
- "sha256": "247c5f488e14c2ad1996d9a7167c69c593da31cb340f09bb1e52a572031db550",
122
+ "sha256": "4fda905ccf93ae321e36de4bc41dd7508825c7073bbbd237fc5b82910094ff70",
123
123
  "size": 7819
124
124
  }
125
125
  ],
126
- "hash": "5834e09bc8fdd24240c35233f8b5035b362a9d289a7f0f7698aac7480d1ef429"
126
+ "hash": "b610b7f938899ce1d6327bac9a4f5788e72bedb2a033ac77cadf8ea7d0a050b5"
127
127
  },
128
128
  {
129
129
  "name": "alphafox-strategy",
130
- "version": "0.3.23",
130
+ "version": "0.3.24",
131
131
  "files": [
132
132
  {
133
133
  "path": "SKILL.md",
134
- "sha256": "cf1e0c364de027cdf63113848ae9eb2194e1efc8025c3224da3fd86cf6990adc",
134
+ "sha256": "b1caecced015cb227842153660744470a1092e823d2b355570c7e396ee3c9c5d",
135
135
  "size": 8039
136
136
  }
137
137
  ],
138
- "hash": "a17d382e02007479b66f2b879d38c7eaaa802738dc679e2e96bf42ed7d9eeb4b"
138
+ "hash": "57df3973cfcae8accccb5d65f16efd1fa0cde6d670f03ee318077db1d57c4e03"
139
139
  },
140
140
  {
141
141
  "name": "alphafox-trading",
142
- "version": "0.3.23",
142
+ "version": "0.3.24",
143
143
  "files": [
144
144
  {
145
145
  "path": "SKILL.md",
146
- "sha256": "70b4ad0b01e29102024141337f28bda4fb6cdf38292cd5001411908830a8a747",
146
+ "sha256": "ba28488c9a46ea5da006940603580a05811939d9a6abbc4f14be69d315c04b2a",
147
147
  "size": 4920
148
148
  }
149
149
  ],
150
- "hash": "b12154ddcc48a9b0248548f935bcae940b9d514b5c233f7c5e5590ef449ac329"
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.23";
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.23";
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alphafox/cli",
3
- "version": "0.3.23",
3
+ "version": "0.3.24",
4
4
  "description": "AlphaFox CLI — Agent/Human entry for the public Application API.",
5
5
  "type": "commonjs",
6
6
  "bin": {
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: alphafox-account
3
3
  description: Account, wallet, and subscription read paths.
4
- version: 0.3.23
4
+ version: 0.3.24
5
5
  ---
6
6
 
7
7
  # Account / wallet
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: alphafox-admin
3
3
  description: Admin-only operations reusing Web role authorization.
4
- version: 0.3.23
4
+ version: 0.3.24
5
5
  ---
6
6
 
7
7
  # Admin
@@ -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.23
4
+ version: 0.3.24
5
5
  ---
6
6
 
7
7
  # AlphaFox
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: alphafox-shared
3
3
  description: Shared AlphaFox CLI rules for Agents — auth, profiles, envelopes, risk gates, public operationIds, and dashboard links after 回测 / 运行策略 / 排行榜.
4
- version: 0.3.23
4
+ version: 0.3.24
5
5
  ---
6
6
 
7
7
  # AlphaFox shared Agent contract
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: alphafox-auth
3
3
  description: Login, status, logout, whoami, and environment isolation for AlphaFox CLI.
4
- version: 0.3.23
4
+ version: 0.3.24
5
5
  ---
6
6
 
7
7
  # Auth Skill
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: alphafox-cache
3
3
  description: Inspect and clean local Engine backtest caches (downloaded OHLCV tape and wasm runtime). Use when the user asks to 清理缓存, free disk, or after a large historical backtest.
4
- version: 0.3.23
4
+ version: 0.3.24
5
5
  ---
6
6
 
7
7
  # Cache
@@ -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.23
4
+ version: 0.3.24
5
5
  ---
6
6
 
7
7
  # Engine Backtest
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: alphafox-exchange
3
3
  description: Exchange connectors list and connection management via Public API.
4
- version: 0.3.23
4
+ version: 0.3.24
5
5
  ---
6
6
 
7
7
  # Exchange connectors
@@ -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.23
4
+ version: 0.3.24
5
5
  ---
6
6
 
7
7
  # Market
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: alphafox-notification
3
3
  description: Notification channels and subscriptions.
4
- version: 0.3.23
4
+ version: 0.3.24
5
5
  ---
6
6
 
7
7
  # Notification
@@ -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.23
4
+ version: 0.3.24
5
5
  ---
6
6
 
7
7
  # Strategy definitions
@@ -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.23
4
+ version: 0.3.24
5
5
  ---
6
6
 
7
7
  # Running strategies (traders)