@alphafox/cli 0.3.5 → 0.3.7

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,141 +1,141 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "packageName": "@alphafox/cli",
4
- "packageVersion": "0.3.5",
4
+ "packageVersion": "0.3.7",
5
5
  "contractVersion": "2026-08-13",
6
- "bundleHash": "797ff48c83d6f0274e8726c4c6b5a3c9271c79116e9d8f90a268b4936efaeb65",
6
+ "bundleHash": "e12e1922538778707e60e931a247ecebb3e028cefeba295f4ca299d8d82d661b",
7
7
  "skills": [
8
8
  {
9
9
  "name": "alphafox",
10
- "version": "0.3.5",
10
+ "version": "0.3.7",
11
11
  "files": [
12
12
  {
13
13
  "path": "SKILL.md",
14
- "sha256": "9b96984c09a656ef1f0c2b8c2d4c0c7a2ae10177d1b0abe0470ea9e5687095cd",
15
- "size": 2184
14
+ "sha256": "2cd53898008075e68afd8ce955b63cf61f2971ef28f6c13c41853b1c5de967c8",
15
+ "size": 3553
16
16
  }
17
17
  ],
18
- "hash": "1662dc2d889ef7429a4abf53061c6b5e83b2665998b4ccbfbf43338f373ef938"
18
+ "hash": "d687ecf8cc366e26dcb535bf31a30faceb037f021c818fa24997d144a22d3c20"
19
19
  },
20
20
  {
21
21
  "name": "alphafox-account",
22
- "version": "0.3.5",
22
+ "version": "0.3.7",
23
23
  "files": [
24
24
  {
25
25
  "path": "SKILL.md",
26
- "sha256": "5e6244d3072e7cd9c9a5603d9c72e8ddf959cbca870f81603b7cfcb8d35b6212",
26
+ "sha256": "fc5675dc44494227679994b761ca2e014d36acc207c68e3fb6d833912a7644ee",
27
27
  "size": 783
28
28
  }
29
29
  ],
30
- "hash": "674fe691cdf52c64af5360c09475b7444e8ce6a1c59fa061c39d9ed6b1dfd78e"
30
+ "hash": "bc1352e9d352f313f69f5257ba351137778c3ee1d8714d2d80fc39c0824c5cec"
31
31
  },
32
32
  {
33
33
  "name": "alphafox-admin",
34
- "version": "0.3.5",
34
+ "version": "0.3.7",
35
35
  "files": [
36
36
  {
37
37
  "path": "SKILL.md",
38
- "sha256": "cf3503e7d8114767b806d3d2349695b0a2af582d470c16c99064df60792baaca",
38
+ "sha256": "6594e6cbfd319a41ae3abf9bf4f8239bb42bc25e6eec295999fe39cd694b2b8b",
39
39
  "size": 787
40
40
  }
41
41
  ],
42
- "hash": "e33bb16a3f241ff29423023aebc044c26c6b4689feabe9b5f780dc3a5bdbb4a5"
42
+ "hash": "d6c5573444a020f376d51a73d44f39da9de8ea20bfd160f838b0de01bbb5e798"
43
43
  },
44
44
  {
45
45
  "name": "alphafox-auth",
46
- "version": "0.3.5",
46
+ "version": "0.3.7",
47
47
  "files": [
48
48
  {
49
49
  "path": "SKILL.md",
50
- "sha256": "848fcd9422977c0bb3ee3355c2359c6efbb54e964b64ea253660e7ee12598f1a",
50
+ "sha256": "b7b2694cbcf6e784d89943950435cb34454309cfbe07e383cc028a435dfec77d",
51
51
  "size": 1919
52
52
  }
53
53
  ],
54
- "hash": "c17ebdb46ebb36036d9958d8a6a31717af6945267575d7464561728e0c9d3205"
54
+ "hash": "aa7e2a39058660c4c803ed6e1bed94da0559aa943998336d6f0c83d8930a1d9d"
55
55
  },
56
56
  {
57
57
  "name": "alphafox-engine-backtest",
58
- "version": "0.3.5",
58
+ "version": "0.3.7",
59
59
  "files": [
60
60
  {
61
61
  "path": "SKILL.md",
62
- "sha256": "8e91f3779ee93b680b90fa21d0e7e8fa7cc5ad4ca89941e1b9076526f09075e2",
63
- "size": 7346
62
+ "sha256": "e09e938c9dd90d0be156b2d8bd83ba854c4d1a190a1b4aa575ca67db70184ebc",
63
+ "size": 7584
64
64
  }
65
65
  ],
66
- "hash": "73943798e3787ad78a9955aad937154ca0b8a975e44117b78f1afecc9866f13b"
66
+ "hash": "91de2131ffde0b9fef16221d5589a8c430ae48ddfc4f2dc781d510b9d4c90532"
67
67
  },
68
68
  {
69
69
  "name": "alphafox-exchange",
70
- "version": "0.3.5",
70
+ "version": "0.3.7",
71
71
  "files": [
72
72
  {
73
73
  "path": "SKILL.md",
74
- "sha256": "ea7d153cd5806f471e45e5df2f0558835aa6ad413abe92667352288fa534ff2a",
74
+ "sha256": "53cba327c5507266b4dca7193fad67ba33c0c7bb745be41fd194425b9ef5928e",
75
75
  "size": 743
76
76
  }
77
77
  ],
78
- "hash": "88d3826590356eed7b3a3405188242ca7e3936856fcd74400c06da701da0b062"
78
+ "hash": "910f451fc7939926cfbeee27ee72f2aae86fcdd78f343e9f02c30df105ac6480"
79
79
  },
80
80
  {
81
81
  "name": "alphafox-market",
82
- "version": "0.3.5",
82
+ "version": "0.3.7",
83
83
  "files": [
84
84
  {
85
85
  "path": "SKILL.md",
86
- "sha256": "c816116463f6b8ef7d7281593500153119bd62d6635517faf71e769e36522385",
87
- "size": 1801
86
+ "sha256": "6589628478dc9c98c20479a2ffdded4014ce71b9c488dd386a606fef25a37d26",
87
+ "size": 3078
88
88
  }
89
89
  ],
90
- "hash": "01ae4ac923c4284af527f78991784e9b1bf2599daa57dcead89f2f72510278df"
90
+ "hash": "84d243b7c53c519cba34c8c487ba23eae60bde8440c4dcfff06e20efd63c07fa"
91
91
  },
92
92
  {
93
93
  "name": "alphafox-notification",
94
- "version": "0.3.5",
94
+ "version": "0.3.7",
95
95
  "files": [
96
96
  {
97
97
  "path": "SKILL.md",
98
- "sha256": "00c6b87f4742c3c5ea07276228c4b1ba718683abdf6e40c35024b270ec4abd49",
98
+ "sha256": "8b985ff7f33696eb11427147cd021d32654f525eea54f8098f368e8750a59381",
99
99
  "size": 698
100
100
  }
101
101
  ],
102
- "hash": "c23e5ed2458d8d2fa58f04b24a1efe300c554b2029f9b218685d204c5f9ed2b7"
102
+ "hash": "1f316dc3fe251699b3f90102cbc16cb4fbd3a3c5c07b923297c075fe2e73a4b3"
103
103
  },
104
104
  {
105
105
  "name": "alphafox-shared",
106
- "version": "0.3.5",
106
+ "version": "0.3.7",
107
107
  "files": [
108
108
  {
109
109
  "path": "SKILL.md",
110
- "sha256": "c8b7624e43242c3bf1a5f5e8d2101a6b53a0a7c62f04afac079e49a478eaaca9",
111
- "size": 4750
110
+ "sha256": "3aac1ab46a759a2c6748516936f886ec028e680bff7deb3ff1abc51af99ed18a",
111
+ "size": 5163
112
112
  }
113
113
  ],
114
- "hash": "a8d5bedffabb5b0c715bf88bd94f7a3ef4e3be77f854065806d4dd1440ef606f"
114
+ "hash": "72a7255ab23ff7c1adf41b1ff2e22834d1b58ee9e2ccea990c64f9277bf8b0a3"
115
115
  },
116
116
  {
117
117
  "name": "alphafox-strategy",
118
- "version": "0.3.5",
118
+ "version": "0.3.7",
119
119
  "files": [
120
120
  {
121
121
  "path": "SKILL.md",
122
- "sha256": "8f94ea6fc3d36ddc8e6808e1e6ebdfcec56973a93fc86d0c6832eff2d6cf4022",
123
- "size": 1450
122
+ "sha256": "1ef2a00dd1c74922a3d0248041813609fc58701e7857bb069cbed511b0c46168",
123
+ "size": 1826
124
124
  }
125
125
  ],
126
- "hash": "b1f5c6ae08bc2ea486b32c34c2e271ea504843972ccc7dbbb1e7e68d6a714f7d"
126
+ "hash": "44c2bf74ff053977f3a8631115ebf868af7cff33856e0c6a4fe55080049c1ae1"
127
127
  },
128
128
  {
129
129
  "name": "alphafox-trading",
130
- "version": "0.3.5",
130
+ "version": "0.3.7",
131
131
  "files": [
132
132
  {
133
133
  "path": "SKILL.md",
134
- "sha256": "2eddaa9c903daa62790ead007db4f0f6f412d1a14b291025937927eda6719d03",
135
- "size": 1435
134
+ "sha256": "db065fcc272e66d091cfe7469317d7911946f96094f475f64d34d201c392424c",
135
+ "size": 3122
136
136
  }
137
137
  ],
138
- "hash": "d4b9e260145aca858e4d3a1f13bf81081c96bd8048d8d6eeb487e35dd78129fb"
138
+ "hash": "af36dc51e47ca91cb4a2f5ca78e03e17f003ee47b5354cef42947f401fbe48c0"
139
139
  }
140
140
  ]
141
141
  }
@@ -0,0 +1,24 @@
1
+ export declare const UPDATE_CHECK_INTERVAL_MS: number;
2
+ export interface UpdateCheckState {
3
+ readonly schemaVersion: 1;
4
+ readonly checkedAt: string;
5
+ readonly currentVersion: string;
6
+ readonly latestVersion: string | null;
7
+ readonly updateAvailable: boolean;
8
+ }
9
+ export interface UpdateNoticeResult {
10
+ readonly checked: boolean;
11
+ readonly notified: boolean;
12
+ readonly latestVersion: string | null;
13
+ }
14
+ export interface UpdateNoticeDeps {
15
+ readonly env?: NodeJS.ProcessEnv;
16
+ readonly currentVersion?: string;
17
+ readonly now?: Date;
18
+ readonly fetchLatest?: () => Promise<string>;
19
+ readonly writeNotice?: (line: string) => void;
20
+ }
21
+ export declare function updateCheckStatePath(env?: NodeJS.ProcessEnv): string;
22
+ export declare function formatUpdateNotice(currentVersion: string, latestVersion: string): string;
23
+ export declare function shouldSkipUpdateCheck(command: string | undefined, env?: NodeJS.ProcessEnv): boolean;
24
+ export declare function maybeNotifyCliUpdate(deps?: UpdateNoticeDeps): Promise<UpdateNoticeResult>;
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UPDATE_CHECK_INTERVAL_MS = void 0;
4
+ exports.updateCheckStatePath = updateCheckStatePath;
5
+ exports.formatUpdateNotice = formatUpdateNotice;
6
+ exports.shouldSkipUpdateCheck = shouldSkipUpdateCheck;
7
+ exports.maybeNotifyCliUpdate = maybeNotifyCliUpdate;
8
+ const node_fs_1 = require("node:fs");
9
+ const node_path_1 = require("node:path");
10
+ const profiles_1 = require("../config/profiles");
11
+ const exec_1 = require("../install/exec");
12
+ const wizard_1 = require("../install/wizard");
13
+ const version_1 = require("../version");
14
+ exports.UPDATE_CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000;
15
+ const NPM_VIEW_TIMEOUT_MS = 4_000;
16
+ function updateCheckStatePath(env = process.env) {
17
+ return (0, node_path_1.join)((0, profiles_1.defaultConfigDir)(env), "update-check.json");
18
+ }
19
+ function formatUpdateNotice(currentVersion, latestVersion) {
20
+ return `[alphafox] update available: ${currentVersion} -> ${latestVersion}. After the user confirms, run: alphafox update --format json --no-input`;
21
+ }
22
+ function shouldSkipUpdateCheck(command, env = process.env) {
23
+ if (env.ALPHAFOX_SKIP_UPDATE_CHECK === "1")
24
+ return true;
25
+ return command === "update" || command === "install";
26
+ }
27
+ async function maybeNotifyCliUpdate(deps = {}) {
28
+ const env = deps.env ?? process.env;
29
+ const currentVersion = deps.currentVersion ?? version_1.CLI_VERSION;
30
+ const now = deps.now ?? new Date();
31
+ const writeNotice = deps.writeNotice ??
32
+ ((line) => {
33
+ process.stderr.write(`${line}\n`);
34
+ });
35
+ const previous = loadUpdateCheckState(updateCheckStatePath(env));
36
+ if (previous &&
37
+ now.getTime() - Date.parse(previous.checkedAt) < exports.UPDATE_CHECK_INTERVAL_MS) {
38
+ return {
39
+ checked: false,
40
+ notified: false,
41
+ latestVersion: previous.latestVersion,
42
+ };
43
+ }
44
+ let latestVersion = null;
45
+ try {
46
+ latestVersion = await (deps.fetchLatest ?? defaultFetchLatest)(env);
47
+ }
48
+ catch {
49
+ saveUpdateCheckState(updateCheckStatePath(env), {
50
+ schemaVersion: 1,
51
+ checkedAt: now.toISOString(),
52
+ currentVersion,
53
+ latestVersion: previous?.latestVersion ?? null,
54
+ updateAvailable: false,
55
+ });
56
+ return {
57
+ checked: true,
58
+ notified: false,
59
+ latestVersion: previous?.latestVersion ?? null,
60
+ };
61
+ }
62
+ const updateAvailable = (0, wizard_1.semverLessThan)(currentVersion, latestVersion);
63
+ saveUpdateCheckState(updateCheckStatePath(env), {
64
+ schemaVersion: 1,
65
+ checkedAt: now.toISOString(),
66
+ currentVersion,
67
+ latestVersion,
68
+ updateAvailable,
69
+ });
70
+ if (updateAvailable) {
71
+ writeNotice(formatUpdateNotice(currentVersion, latestVersion));
72
+ }
73
+ return {
74
+ checked: true,
75
+ notified: updateAvailable,
76
+ latestVersion,
77
+ };
78
+ }
79
+ function loadUpdateCheckState(path) {
80
+ if (!(0, node_fs_1.existsSync)(path))
81
+ return null;
82
+ try {
83
+ const parsed = JSON.parse((0, node_fs_1.readFileSync)(path, "utf8"));
84
+ if (parsed.schemaVersion !== 1 ||
85
+ typeof parsed.checkedAt !== "string" ||
86
+ Number.isNaN(Date.parse(parsed.checkedAt))) {
87
+ return null;
88
+ }
89
+ return parsed;
90
+ }
91
+ catch {
92
+ return null;
93
+ }
94
+ }
95
+ function saveUpdateCheckState(path, state) {
96
+ (0, node_fs_1.mkdirSync)((0, node_path_1.join)(path, ".."), { recursive: true });
97
+ (0, node_fs_1.writeFileSync)(path, `${JSON.stringify(state, null, 2)}\n`, { mode: 0o600 });
98
+ }
99
+ async function defaultFetchLatest(env) {
100
+ const runner = (0, exec_1.createDefaultInstallRunner)(env, []);
101
+ const { stdout } = await runner.exec("npm", ["view", version_1.CLI_PACKAGE, "version"], {
102
+ timeoutMs: NPM_VIEW_TIMEOUT_MS,
103
+ });
104
+ const version = stdout.trim();
105
+ if (!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(version)) {
106
+ throw new Error(`invalid npm version: ${version}`);
107
+ }
108
+ return version;
109
+ }
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.5";
3
+ export declare const CLI_VERSION = "0.3.7";
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.5";
6
+ exports.CLI_VERSION = "0.3.7";
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; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alphafox/cli",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
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.5
4
+ version: 0.3.7
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.5
4
+ version: 0.3.7
5
5
  ---
6
6
 
7
7
  # Admin
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: alphafox
3
- description: AlphaFox CLI entry router. Use for any AlphaFox request — install, update, login, whoami, 回测, engine backtest, strategy chat, traders, ticker/标的 resolve, market data, exchange connectors, wallet, subscriptions, notifications, or admin. Start here, then open the routed domain skill. Do not guess alphafox-engine-backtest vs alphafox-strategy from memory.
4
- version: 0.3.5
3
+ description: AlphaFox CLI entry router. Use for any AlphaFox request — install, update, login, whoami, 回测, engine backtest, strategy definitions, create/list/start/stop a running strategy (trader), ticker/标的 resolve (美股 or crypto), market data, exchange connectors, wallet, subscriptions, notifications, or admin. If a CLI command prints `[alphafox] update available`, ask the user「检测到新的版本,是否需要我帮你升级?」and only then run `alphafox update --format json --no-input`. Start here, then open the routed domain skill. Do not guess alphafox-engine-backtest vs alphafox-strategy vs alphafox-trading from memory.
4
+ version: 0.3.7
5
5
  ---
6
6
 
7
7
  # AlphaFox
@@ -10,7 +10,9 @@ This skill only routes. After choosing a row, **read that skill's `SKILL.md` and
10
10
 
11
11
  Also read `alphafox-shared` before any CLI invocation (envelope, auth, risk, schema-first writes). Always `--format json --no-input`. Never `--token`.
12
12
 
13
- Human-mentioned tickers go through `alphafox-market` (`alphafox resolve-symbols`) **before** they enter config, backtest, or writes.
13
+ Human-mentioned tickers go through `alphafox-market` (`alphafox resolve-symbols`) **before** they enter config, backtest, or writes. Keep the operator's asset class (美股 → `equity_perp` on `binance_perp_usdt`).
14
+
15
+ A **trader** is a running strategy instance (paper or live), not a person. Creating a strategy means creating a trader.
14
16
 
15
17
  ## Route
16
18
 
@@ -18,21 +20,43 @@ Human-mentioned tickers go through `alphafox-market` (`alphafox resolve-symbols`
18
20
  |---|---|
19
21
  | Install, update, Skills status/sync, doctor, version, catalog, how to call the CLI | `alphafox-shared` |
20
22
  | Login, logout, whoami, profile, staging vs production | `alphafox-auth` |
21
- | Coin / ticker / 标的 / `BTC/USDT:USDT` / resolve a misspelled symbol | `alphafox-market` |
23
+ | Ticker / 标的 / 美股 / crypto / resolve a misspelled symbol | `alphafox-market` |
22
24
  | Engine WASM backtest, experiment, `engine-backtest run`, persist a local run | `alphafox-engine-backtest` |
23
- | Strategy chat, compiled strategy | `alphafox-strategy` |
24
- | List / start / stop traders | `alphafox-trading` |
25
+ | Strategy types / definitions / validate config (grid, dca, copy, …) | `alphafox-strategy` |
26
+ | Create, list, start, or stop a running strategy (trader), including copy | `alphafox-trading` |
25
27
  | Exchange connectors | `alphafox-exchange` |
26
28
  | Account, wallet, subscription | `alphafox-account` |
27
29
  | Notification channels | `alphafox-notification` |
28
30
  | Admin-only operations | `alphafox-admin` |
29
31
 
30
- If several rows apply, load **all** of them (typical: `alphafox-shared` + `alphafox-market` + one domain skill).
32
+ If several rows apply, load **all** of them (typical: `alphafox-shared` + `alphafox-market` + one domain skill). “帮我建一个网格/DCA/跟单策略” → `alphafox-strategy` (pick the definition) **and** `alphafox-trading` (create the trader).
33
+
34
+ ## Upgrade reminder
35
+
36
+ The CLI may print this on **stderr** at most once every 24 hours:
37
+
38
+ ```text
39
+ [alphafox] update available: 0.3.6 -> 0.3.7. After the user confirms, run: alphafox update --format json --no-input,
40
+ ```
41
+
42
+ If you see that notice (or `updateAvailable: true` from `alphafox update --check`):
43
+
44
+ 1. Ask the user: **检测到新的版本,是否需要我帮你升级?**
45
+ 2. Wait for an explicit yes. Do not upgrade on your own.
46
+ 3. After they confirm:
47
+
48
+ ```bash
49
+ alphafox update --format json --no-input
50
+ ```
51
+
52
+ 4. Tell the user to **restart the AI tool** so the new Skills load.
53
+
54
+ Do not install Skills from GitHub. Details and dry-run / check commands live in `alphafox-shared`.
31
55
 
32
56
  ## Do not mix these backtest paths
33
57
 
34
58
  - Local Engine tape + wasm + optional persist → `alphafox-engine-backtest` (`alphafox engine-backtest run`, hyphen).
35
59
  - Experiment catalog CRUD → same skill, underscore catalog `engine_backtest.*`.
36
- - Chat-attached `/api/v1/backtests` (`backtests.*`) is **not** a CLI surface. Do not call it via typed commands, `schema`, or `alphafox api`.
60
+ - Web `/api/v1/backtests` (`backtests.*`) is **not** a CLI surface. Do not call it via typed commands, `schema`, or `alphafox api`.
37
61
 
38
62
  Ambiguous “帮我回测” → `alphafox-engine-backtest`, after resolving symbols.
@@ -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, and public operationIds only.
4
- version: 0.3.5
4
+ version: 0.3.7
5
5
  ---
6
6
 
7
7
  # AlphaFox shared Agent contract
@@ -24,7 +24,13 @@ npx @alphafox/cli version --format json --no-input
24
24
  npx @alphafox/cli doctor --format json --no-input
25
25
  ```
26
26
 
27
- Update checks are read-only. A real update keeps CLI and Skills co-versioned:
27
+ The CLI checks npm at most once every 24 hours and only prints a notice on
28
+ **stderr**. It never auto-upgrades. If you see
29
+ `[alphafox] update available` (or `updateAvailable: true`), ask the user:
30
+
31
+ **检测到新的版本,是否需要我帮你升级?**
32
+
33
+ Wait for an explicit yes. Then keep CLI and Skills co-versioned:
28
34
 
29
35
  ```bash
30
36
  alphafox update --check --format json --no-input
@@ -32,6 +38,8 @@ alphafox update --format json --no-input
32
38
  alphafox skills status --format json --no-input
33
39
  ```
34
40
 
41
+ After a successful `alphafox update`, tell the user to restart the AI tool.
42
+
35
43
  Never update AlphaFox Skills independently from GitHub. If `skills status`
36
44
  reports local modifications, stop and ask before using
37
45
  `alphafox skills sync --force --yes`; the CLI backs up replaced files.
@@ -68,7 +76,7 @@ Wrong environment / missing permission / missing `--yes`: stop. Do not retry wit
68
76
 
69
77
  ## Commands
70
78
 
71
- User-mentioned tickers (including typos) must be resolved with `alphafox resolve-symbols` before they are written into config. See `skills/market`.
79
+ User-mentioned tickers (including typos) must be resolved with `alphafox resolve-symbols` before they are written into config. See `skills/market`. 美股 are `equity_perp` on `binance_perp_usdt`; do not swap them for a crypto coin.
72
80
 
73
81
  1. Prefer typed catalog: `alphafox schema <operationId>` then invoke domain commands.
74
82
  2. Raw escape hatch only for allowlisted facade:
@@ -96,7 +104,7 @@ Uncataloged writes cannot carry a non-empty body. Find the `operationId` first.
96
104
  ## Risk
97
105
 
98
106
  - `high-risk-write` and uncataloged mutations (`unknown`) require `--yes` (exit code `10` if missing).
99
- - Prefer `--dry-run` first for trader start/stop, withdrawals, admin writes.
107
+ - Prefer `--dry-run` first for trader create/start/stop, withdrawals, admin writes.
100
108
  - Never auto-retry unknown write outcomes.
101
109
  - CLI `--yes` is UX only; the server still enforces role, ownership, and scopes.
102
110
 
@@ -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.5
4
+ version: 0.3.7
5
5
  ---
6
6
 
7
7
  # Auth Skill
@@ -1,25 +1,25 @@
1
1
  ---
2
2
  name: alphafox-engine-backtest
3
3
  description: Local Engine WASM backtest (alphafox engine-backtest run|sweep) vs catalog experiment CRUD.
4
- version: 0.3.5
4
+ version: 0.3.7
5
5
  ---
6
6
 
7
7
  # Engine Backtest
8
8
 
9
9
  Always `--format json --no-input` (or `--format jsonl` when you need progress). Never `--token`. Tokens live in the OS keychain via `alphafox auth login`.
10
10
 
11
- Human-mentioned tickers must be resolved with `alphafox resolve-symbols` (`skills/market`) before they go into `--config`. Use `data.queries[].resolved` only when `status` is `exact`, or `close` after confirming with the human. Do not invent `BTC/USDT:USDT`. Aster is in the public catalog but is **not** an Engine tape source.
11
+ Human-mentioned tickers must be resolved with `alphafox resolve-symbols` (`skills/market`) before they go into `--config`. Use `data.queries[].resolved` only when `status` is `exact`, or `close` after confirming with the human, and only when `assetClass` matches the operator (美股 → `equity_perp`). Local Engine tape is Binance-style USDT-M perps (`binance|okx|bybit|bitget|hyperliquid`), which is the same catalog that lists equity perps. Aster is in the public catalog but is **not** an Engine tape source. Do not rewrite `NVDA/USDT:USDT` into a crypto coin to force a backtest.
12
12
 
13
13
  ## Which command
14
14
 
15
15
  | Intent | Use | Do not |
16
16
  |---|---|---|
17
17
  | Iterate a strategy locally (pull tape + run wasm + optional persist) | `alphafox engine-backtest run` (hyphen, built-in) | Do not treat this as server-side execution of `engine_backtest.experiments.byId.runs.create` |
18
- | Local parameter search with explicit axes; persist one Sweep after completion | `alphafox engine-backtest sweep` | Never loop `runs.create` per coordinate. Do not call Chat `backtests.*` |
18
+ | Local parameter search with explicit axes; persist one Sweep after completion | `alphafox engine-backtest sweep` | Never loop `runs.create` per coordinate. Do not call `backtests.*` |
19
19
  | Local search with zero writes | `alphafox engine-backtest sweep ... --no-persist` | Do not persist a cancelled or incomplete search |
20
20
  | List / get / delete persisted Sweeps | Catalog `engine_backtest.experiments.byId.sweeps.*` | Do not invent a second catalog. Delete is high-risk and needs `--yes` |
21
21
  | List / get / create / rename / delete experiments and persisted runs | Catalog `engine_backtest.*` (underscore) | Do not invent a second catalog |
22
- | Chat-attached `/api/v1/backtests` job | — | Not a CLI surface. Do not call `backtests.*` or `/api/v1/backtests` |
22
+ | Web `/api/v1/backtests` job | — | Not a CLI surface. Do not call `backtests.*` or `/api/v1/backtests` |
23
23
 
24
24
  Read the create-experiment body with `alphafox schema` **before** composing JSON. Do not invent experiment fields. Large create/run/sweep payloads use `--config @file`, never a guessed `--body`.
25
25
 
@@ -110,4 +110,4 @@ Owner isolation and 7-day expiry are enforced by the server. Applying a coordina
110
110
  - `engine_backtest.experiments.byId.sweeps.byId.get`
111
111
  - High-risk (not this skill's run/sweep path): `engine_backtest.experiments.byId.update` / `.byId.delete` / `.byId.runs.byId.delete` / `.byId.sweeps.byId.delete`
112
112
 
113
- Chat `backtests.*` is not an Engine Sweep or Engine Run surface. Do not call it from this skill.
113
+ `backtests.*` is not an Engine Sweep or Engine Run surface. Do not call it from this skill.
@@ -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.5
4
+ version: 0.3.7
5
5
  ---
6
6
 
7
7
  # Exchange connectors
@@ -1,33 +1,53 @@
1
1
  ---
2
2
  name: alphafox-market
3
- description: Market data, ticker resolution, and spread-radar readonly queries.
4
- version: 0.3.5
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.7
5
5
  ---
6
6
 
7
7
  # Market
8
8
 
9
9
  Always `--format json --no-input`. Prefer readonly scopes. No mock success if upstream fails.
10
10
 
11
- ## Resolve tickers first
11
+ ## Asset class first
12
12
 
13
- Whenever a human mentions a coin, ticker, or contract including typos resolve it **before** putting a symbol into strategy config, backtest, chat settings, or any write.
13
+ Binance US stocks are **equity perps in the same** `binance_perp_usdt` catalog (`NVDA/USDT:USDT`). They are not a second exchange. `symbolMetadata` tags them:
14
+
15
+ | Tag | Meaning |
16
+ |---|---|
17
+ | `assetClass: "equity_perp"` and `isTradFiRwa: true` | US stock perp (NVDA, AAPL, TSLA) |
18
+ | `assetClass: "rwa_perp"` and `isTradFiRwa: true` | TradFi RWA perp (XAU, XAG) |
19
+ | untagged / not TradFi | Crypto perp (BTC, ETH) |
20
+
21
+ | Operator said | Resolve with |
22
+ |---|---|
23
+ | 美股 / US stocks / 持仓 / NVDA the company | `--exchange binance --asset-class equity_perp` |
24
+ | 黄金 / 白银 / RWA | `--exchange binance --asset-class rwa_perp` |
25
+ | BTC / ETH / 加密永续 | `--exchange binance` or `--asset-class crypto` |
26
+
27
+ `NVDA/USDT:USDT` with `equity_perp` **is** the US stock product. Do not replace it with a different crypto base.
28
+
29
+ ## Resolve tickers
30
+
31
+ Whenever a human mentions a stock, coin, ticker, or contract — including typos — resolve it **before** putting a symbol into strategy config, backtest, trader settings, or any write.
14
32
 
15
33
  ```bash
16
- alphafox resolve-symbols BTC ETH 龙虾 --exchange binance --format json --no-input
34
+ alphafox resolve-symbols BTC ETH --exchange binance --format json --no-input
35
+ alphafox resolve-symbols NVDA AAPL TSLA --exchange binance --asset-class equity_perp --format json --no-input
17
36
  ```
18
37
 
19
38
  - Default `--exchange` is Binance (`binance_perp_usdt`). Aliases: `binance|okx|bybit|bitget|hyperliquid|aster`.
20
- - This built-in loads the public linear-perp catalog via `market.symbols.list` (`GET /api/v1/market/symbols?exchange=...`) and matches locally. Do not guess `BTC/USDT:USDT` from memory. Do not pull a second ccxt universe.
21
- - Read `data.queries[]`. `resolved` is a CCXT linear swap id (`BTC/USDT:USDT`). `matchCount` is the full hit count; `matches` may be capped by `--limit`.
39
+ - This built-in loads `GET /api/v1/market/symbols?exchange=...` (includes `symbolMetadata`) and matches locally. Do not invent a symbol from memory. Do not pull a second ccxt universe.
40
+ - Read `data.queries[]`. `resolved` is a catalog id such as `NVDA/USDT:USDT` or `BTC/USDT:USDT`. Also read `assetClass` and `isTradFiRwa` on the query and on `matches[]`.
41
+ - `matchCount` is the full hit count; `matches` may be capped by `--limit`.
22
42
 
23
43
  | `status` | Agent action |
24
44
  |---|---|
25
- | `exact` | Use `resolved`. No confirmation. |
26
- | `close` | One near match already in `resolved`. Use it, then **confirm with the human**. |
27
- | `ambiguous` | `resolved` is null. Show `matches[].symbol` and ask the human to pick. Do not pick. |
28
- | `none` | Stop. Ask the human for another ticker. Do not invent a symbol. |
45
+ | `exact` | Use `resolved` when `assetClass` matches the operator (美股 → `equity_perp`). |
46
+ | `close` | One near match already in `resolved`. Confirm with the human, and confirm the asset class. |
47
+ | `ambiguous` | `resolved` is null. Show `matches[].symbol` plus `assetClass` and ask the human to pick. Do not pick. |
48
+ | `none` | Stop. Ask for another ticker. Do not invent a symbol and do not swap in a crypto coin. |
29
49
 
30
- Do not treat `close` as exact. Do not retry a failed resolve as a different exchange unless the operator names one.
50
+ Do not treat `close` as exact. Do not retry a failed equity resolve as a different crypto base.
31
51
 
32
52
  Raw catalog dump (no matching):
33
53
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: alphafox-notification
3
3
  description: Notification channels and subscriptions.
4
- version: 0.3.5
4
+ version: 0.3.7
5
5
  ---
6
6
 
7
7
  # Notification