@alphafox/cli 0.3.20 → 0.3.21

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,153 +1,153 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "packageName": "@alphafox/cli",
4
- "packageVersion": "0.3.20",
4
+ "packageVersion": "0.3.21",
5
5
  "contractVersion": "2026-08-31",
6
- "bundleHash": "ca170c6f023704493568335720fd82f73cd7b7a34dab795e39f3920cfa4d47d5",
6
+ "bundleHash": "3b1e1c9968daa5b78e782cdb9a3e824b9fd69dfe20c90fd81fe457dd5b051f53",
7
7
  "skills": [
8
8
  {
9
9
  "name": "alphafox",
10
- "version": "0.3.20",
10
+ "version": "0.3.21",
11
11
  "files": [
12
12
  {
13
13
  "path": "SKILL.md",
14
- "sha256": "87bfa86a0be66a6737282286b3def88cc15485dac3245ea26d462334a03cc686",
14
+ "sha256": "2152cddf61791a680d9a12e561afa858f70ae862fe938ffdda8c9224f186664e",
15
15
  "size": 7950
16
16
  }
17
17
  ],
18
- "hash": "1717e3a193ebc73813d7029dc700d735bdded791a628a8d42a40245912b7effc"
18
+ "hash": "1cebc25d526364cf90f859407485d7431fb04921e7b7f2102c3f2cc1c52ae1f6"
19
19
  },
20
20
  {
21
21
  "name": "alphafox-account",
22
- "version": "0.3.20",
22
+ "version": "0.3.21",
23
23
  "files": [
24
24
  {
25
25
  "path": "SKILL.md",
26
- "sha256": "cda48226d5c00160a5373a457f813f9fe9b44fe8e17a1ff9e267e507b586227a",
26
+ "sha256": "9897b6cdc67bc3b439d0ee8d20a73b1b195f434282f443cdd4b386da64926148",
27
27
  "size": 784
28
28
  }
29
29
  ],
30
- "hash": "271fad09bfdabbea108182f32e03ee660e30f8f69b176c128b67491c3cb95bea"
30
+ "hash": "c11aaaa4a6fff64003f2ed6f842eb2879da9de82d90bb86e7b95224b958621f0"
31
31
  },
32
32
  {
33
33
  "name": "alphafox-admin",
34
- "version": "0.3.20",
34
+ "version": "0.3.21",
35
35
  "files": [
36
36
  {
37
37
  "path": "SKILL.md",
38
- "sha256": "87c7141e1a4eb23f62ef5091a1d329d4d63926c7ffecd9f36fe2363c5ae77baa",
38
+ "sha256": "bc94cab7004cb17c8b87c4af22d3dfe95bf51c4bdde3bd84cdaebbc056584322",
39
39
  "size": 2078
40
40
  }
41
41
  ],
42
- "hash": "af6a0f2e8438578ba047e5f95bb69e7ce0919f5d947634203bdd0a1aea963e39"
42
+ "hash": "073a7e1cc246b0c77a376e279ba09d7e049639c8e63074415fcfe26198ee1903"
43
43
  },
44
44
  {
45
45
  "name": "alphafox-auth",
46
- "version": "0.3.20",
46
+ "version": "0.3.21",
47
47
  "files": [
48
48
  {
49
49
  "path": "SKILL.md",
50
- "sha256": "285ff81745bb8336af4b0d68ae1d6fb212120d357b0b70f1a090815d4b3038b2",
50
+ "sha256": "c576ef7a5ac20933def1bc334e3347b0951ad0692ff4b4ea92fe89a4052b5ee4",
51
51
  "size": 2371
52
52
  }
53
53
  ],
54
- "hash": "f2dcab96b60491f9a3c18bcbd7e4a855ee645c144e2178351091b3c0d72d5830"
54
+ "hash": "41c831e8be2311f3abf393a9a502b2bbe6f79a383dfa9ee125a6b6f70e38e2f4"
55
55
  },
56
56
  {
57
57
  "name": "alphafox-cache",
58
- "version": "0.3.20",
58
+ "version": "0.3.21",
59
59
  "files": [
60
60
  {
61
61
  "path": "SKILL.md",
62
- "sha256": "1bfd3487e1d155f8c250d6f1f96b555f56ca267f99691845656e60026bf98db8",
62
+ "sha256": "7b068ca3e06f221ea9306d441c56468852dfbb965e07f1675f1c423587520ca8",
63
63
  "size": 1530
64
64
  }
65
65
  ],
66
- "hash": "a3e23a1ec43760757473b54604aa8e6535cf4c9329884ff5e408365e77baf9e1"
66
+ "hash": "8d97f1d8c423dbdabdf6aaf66e2d129d76319b0d4b803690cfe454239e237088"
67
67
  },
68
68
  {
69
69
  "name": "alphafox-engine-backtest",
70
- "version": "0.3.20",
70
+ "version": "0.3.21",
71
71
  "files": [
72
72
  {
73
73
  "path": "SKILL.md",
74
- "sha256": "074c54274b962267101b8b2e6d51c7054345c5d79c841299fa8ccd084e134a9d",
75
- "size": 9360
74
+ "sha256": "a957f0785e76a077b6d1f9f1fa80d43e4a1474ea65d7b2960677c42cdb6f66e2",
75
+ "size": 9792
76
76
  }
77
77
  ],
78
- "hash": "d43d2be349a3c4e97c45d3dd560bcaccbffcd6c3dafae9795b7bdd641352b291"
78
+ "hash": "a046f3ef1386b5649d4a019458a790adc978c5e9a69b03a58e64a262bf545f1b"
79
79
  },
80
80
  {
81
81
  "name": "alphafox-exchange",
82
- "version": "0.3.20",
82
+ "version": "0.3.21",
83
83
  "files": [
84
84
  {
85
85
  "path": "SKILL.md",
86
- "sha256": "46ee8cd0b8a4cebce8f15dfa1faec604880ea3547f2c9647b4b820e6d40f2a0a",
86
+ "sha256": "9d11b9c68da4d6948c00b1f2449e170a3ef387f07ccce36db1037d0871b0842a",
87
87
  "size": 744
88
88
  }
89
89
  ],
90
- "hash": "03373a84634e21bcc1325f6d2caa000063e9a6e49794c6f8368b0a1aab28b064"
90
+ "hash": "53b02a31ef1891bbcbb513dae2af48e8978003f3c41585ebab62d940bd8bad07"
91
91
  },
92
92
  {
93
93
  "name": "alphafox-market",
94
- "version": "0.3.20",
94
+ "version": "0.3.21",
95
95
  "files": [
96
96
  {
97
97
  "path": "SKILL.md",
98
- "sha256": "41ded9162c51d32c1bd4b03eaa59fa3a32fb799a27828f1ccdf16d49e449b187",
98
+ "sha256": "3131b98faddf4a85c87a2a4b0b7fb9c0b6c97159bf38dfc61a1c2a2367fc0020",
99
99
  "size": 3079
100
100
  }
101
101
  ],
102
- "hash": "5e54514b833faa00b906424c967dee34c302ea44377c8b6cde43457e358b4a4a"
102
+ "hash": "df030475f2d0c4b53312bc1be8f1c3555062076074c0c207e3d8cd7a223d4f05"
103
103
  },
104
104
  {
105
105
  "name": "alphafox-notification",
106
- "version": "0.3.20",
106
+ "version": "0.3.21",
107
107
  "files": [
108
108
  {
109
109
  "path": "SKILL.md",
110
- "sha256": "ec3682d888512bd5ce3937ca691ce66d1c6ab71bcb834bc26fa65b74baa8f7b1",
110
+ "sha256": "163a697d7c107152dc0a20dcabd06f1d9eb5b9395289e940b228cf599e7e901e",
111
111
  "size": 699
112
112
  }
113
113
  ],
114
- "hash": "f3fecdd9069200c456c3e809679d6d6bf01638aadf1be08861d4dff2fd13309b"
114
+ "hash": "eab1329002b3e97d8a71800de23595a1df35cd0db3e7751382820df5244c9865"
115
115
  },
116
116
  {
117
117
  "name": "alphafox-shared",
118
- "version": "0.3.20",
118
+ "version": "0.3.21",
119
119
  "files": [
120
120
  {
121
121
  "path": "SKILL.md",
122
- "sha256": "41284bfad66f187a3ee57a9134f9cbf341beb1ce20581dcdf5981f2a0af581af",
122
+ "sha256": "95c311b9b091d5c6c21928c499568bba7d78bbf48ffc78204f54560c828213b8",
123
123
  "size": 6920
124
124
  }
125
125
  ],
126
- "hash": "1595fdcb3095ad7ed55af5b2a79e043a389a06c48cb806e2e3e04dd0ab305830"
126
+ "hash": "5b84d0c16f8d1e0b2b5caefa6a5683650450249615fe186d48e987d42eebd264"
127
127
  },
128
128
  {
129
129
  "name": "alphafox-strategy",
130
- "version": "0.3.20",
130
+ "version": "0.3.21",
131
131
  "files": [
132
132
  {
133
133
  "path": "SKILL.md",
134
- "sha256": "6d889ac8c1dde1f2581133975cc23f25b8e2793ee4c90b7c3ccc85ffbe2e01d8",
135
- "size": 4862
134
+ "sha256": "b61a5d3b32c0caaa29280676d0a38c32d895b13991056b8adbde584baeb751d2",
135
+ "size": 7185
136
136
  }
137
137
  ],
138
- "hash": "148851ac3cc355de419b1dafe08f684fa8d7ea98967f14c0b01d83ea0ef800b8"
138
+ "hash": "fa63c05d477ffb58e32c8c8e301189135d78e1a80bcb57cd7997a8533869f5f7"
139
139
  },
140
140
  {
141
141
  "name": "alphafox-trading",
142
- "version": "0.3.20",
142
+ "version": "0.3.21",
143
143
  "files": [
144
144
  {
145
145
  "path": "SKILL.md",
146
- "sha256": "bef37f59c7511127794ba8edbbdde3f56bde543d0051b6dbfe5f0360168a2698",
147
- "size": 4493
146
+ "sha256": "2142e880981ec69bcc4e2605e1f7fd950b0b058ea70d47e7f67b5147c0e6313b",
147
+ "size": 4921
148
148
  }
149
149
  ],
150
- "hash": "538a934c5e807af73da35c7ae85cd3921ee92a00f34648484a1c7e3eeb0fbc52"
150
+ "hash": "cd4386cd59f54ca31eac44cc6fa17eb9b74d0be925f06087d083d9d2370481bd"
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.20";
3
+ export declare const CLI_VERSION = "0.3.21";
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.20";
6
+ exports.CLI_VERSION = "0.3.21";
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.20",
3
+ "version": "0.3.21",
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.20
4
+ version: 0.3.21
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.20
4
+ version: 0.3.21
5
5
  ---
6
6
 
7
7
  # Admin
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: alphafox
3
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. After 回测 or 运行策略, include the dashboard URL from the domain skill. When the user asks 排行榜, include https://www.alphafox.app/zh/dashboard/leaderboard. After a successful install and login, present the 新人引导 in this file (Lite square 带单员 + classic strategies). If a CLI command prints `[alphafox] update available`, ask the user「检测到新的版本,是否需要我帮你升级?」and only then run `alphafox update --format json --no-input`. After a large backtest, if tape cache is large, ask「回测下载的历史数据比较大,要不要我帮你清理本地缓存?」then open `alphafox-cache`. 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.20
4
+ version: 0.3.21
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.20
4
+ version: 0.3.21
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.20
4
+ version: 0.3.21
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.20
4
+ version: 0.3.21
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.20
4
+ version: 0.3.21
5
5
  ---
6
6
 
7
7
  # Engine Backtest
@@ -33,6 +33,8 @@ alphafox schema engine_backtest.experiments.byId.sweeps.create --format json --n
33
33
 
34
34
  The tape runner ships inside the CLI (plus `ccxt` for public-market pulls). The wasm / Node host is downloaded from the public Vercel Blob manifest (`engine-backtest/latest.json`) into `~/.cache/alphafox/engine-backtest/<hash>/` on first run.
35
35
 
36
+ Before planning or running, follow the complete parameter review in `alphafox-strategy`, including when the operator already supplied `--config` or pasted a full command. Do not run the backtest until every applicable parameter, default status, short explanation, proposed value, and value source has been shown and the operator explicitly confirms the final proposal. User overrides win; unresolved required values stop the flow.
37
+
36
38
  Local overrides, in order:
37
39
 
38
40
  1. `ALPHAFOX_BACKTEST_WASM_DIR` / `ALPHAFOX_BACKTEST_RUNNER_DIR`
@@ -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.20
4
+ version: 0.3.21
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.20
4
+ version: 0.3.21
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.20
4
+ version: 0.3.21
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.20
4
+ version: 0.3.21
5
5
  ---
6
6
 
7
7
  # Strategy definitions
@@ -31,18 +31,38 @@ Match the name the operator used against list `id` / `name` / `display`. If they
31
31
  1. `id`, `category` (`COPY` / `DCA` / `GRID` / `TREND` / `OTHERS`), `status`
32
32
  2. English `description` (mechanism). Prefer it over marketing `display.description`
33
33
  3. `capabilities` and `commonModules` (event-driven vs polling, signal sources, manual sync)
34
- 4. `strategyConfigSchema` required fields and each field's `display` — including decision-logic enums inside this definition
34
+ 4. The effective `configSchema`, including composed common modules, strategy parameters, defaults, constraints, conditional branches, and each field's `display`
35
35
  5. `capabilities.actionDefinitions` (what a manual action changes)
36
36
 
37
37
  Explain the type from those fields. Missing a layer → say unknown; do not fill from memory. Decision logic (`simple-long`, grid `mode` `neutral`/`long`/`short`) is an internal parameter, not a new definition id.
38
38
 
39
39
  ## Configure with the human
40
40
 
41
- The human answers knobs. You write JSON.
41
+ The human confirms the complete parameter set. You write JSON only after that review.
42
42
 
43
43
  1. Confirm the definition from `byId.get` in the operator's language (what it is, what drives it, how positions change).
44
- 2. From `strategyConfigSchema` plus common required fields, ask **only** values the human must choose: symbols (resolve first), direction / mode, size, signal source, leverage. Do not walk every optional key. If the operator does not pick leverage, write `common.execution.leverage: 10` (website form default). Omitting the field is not the same Engine treats a missing leverage as **1x**.
45
- 3. Write `strategy-config.json` as the trader object:
44
+ 2. Use the effective `configSchema` returned by `byId.get` as the sole parameter contract. It already composes the definition's `commonModules` with `strategyConfigSchema` and may contain definition-specific customization. Walk every applicable parameter, not only required fields or familiar knobs.
45
+ 3. Resolve conditional schemas in dependency order. Ask for a discriminator or enable/disable choice first, then enumerate every parameter in the selected branch. Do not present inactive branch fields as active settings. For arrays or maps, explain the collection and confirm every field of each configured item.
46
+ 4. Build a grouped or numbered review table in the operator's language. Every applicable parameter must have:
47
+
48
+ - full JSON path;
49
+ - short explanation from localized `display.description`, falling back to the schema's description; if neither exists, say the definition provides no explanation — do not guess;
50
+ - type plus enum, range, or other relevant constraints;
51
+ - default status and source;
52
+ - proposed value and value source.
53
+
54
+ 5. Determine the proposed value in this precedence order:
55
+
56
+ 1. **user override** — any value the operator explicitly supplied, including values already present in a provided config;
57
+ 2. **schema default** — the field's JSON Schema `default`;
58
+ 3. **product default** — only a default explicitly documented by this skill or the live product contract. Currently `common.execution.leverage` is `10`, matching the website form; raw Engine omission means 1x;
59
+ 4. **no default** — required fields remain unresolved and must be answered; optional fields are proposed as “不设置 / omit”. Do not guess a value or describe omission as a default.
60
+
61
+ A user override always wins, even when it equals neither default. Preserve explicit `false`, `0`, empty arrays, and empty strings when the schema allows them; they are not missing values.
62
+
63
+ 6. When there are many parameters, present them in logical groups or numbered chunks so the review remains readable. After all groups are visible, ask the operator to reply **confirm all** / “全部确认”, or override paths/numbers. One overall confirmation is sufficient, but it must cover every displayed parameter. Apply overrides, show the affected rows again, and repeat until no required value is unresolved and the operator explicitly confirms the final proposal.
64
+ 7. An earlier request such as “创建策略”, “运行回测”, or a pasted command/config is input to the proposal, not confirmation of the review. Do not validate, create, or backtest until the complete parameter review is explicitly confirmed.
65
+ 8. Write `strategy-config.json` as the trader object:
46
66
 
47
67
  ```json
48
68
  {
@@ -53,7 +73,7 @@ The human answers knobs. You write JSON.
53
73
 
54
74
  `common` is shared risk / SLTP / execution / market. `strategy` is this type's parameters and decision logic. Do not use top-level `settings`, `policyId`, or `policyParams`. `configSchemaVersion` comes from the definition (`byId.get` / list); keep it off this file.
55
75
 
56
- 4. Keys and enums come from the definition schema, not from this skill. Do not ship a default `grid.json` / `dca.json`. Reuse this source file for `engine-backtest --config` and as `trading.traders.create` `config`.
76
+ 9. Keys and enums come from the definition schema, not from this skill. Do not ship a default `grid.json` / `dca.json`. Reuse this source file for `engine-backtest --config` and as `trading.traders.create` `config`.
57
77
 
58
78
  ## Validate config
59
79
 
@@ -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.20
4
+ version: 0.3.21
5
5
  ---
6
6
 
7
7
  # Running strategies (traders)
@@ -32,6 +32,8 @@ alphafox api GET /api/v1/trading/traders --format json --no-input
32
32
 
33
33
  Read `alphafox schema <operationId>` first. Body may only include documented `request.body` fields. Large / nested bodies use `--config @file`.
34
34
 
35
+ Before composing or dry-running any create request, follow the complete parameter review in `alphafox-strategy`, including when the operator already supplied a config. Do not create a trader until every applicable parameter, default status, short explanation, proposed value, and value source has been shown and the operator explicitly confirms the final proposal. User overrides win; unresolved required values stop the flow.
36
+
35
37
  ```bash
36
38
  alphafox schema trading.traders.create --format json --no-input
37
39
  alphafox trading traders create --config @./create-trader.json --dry-run --format json --no-input