@alphafox/cli 0.3.11 → 0.3.13

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,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.11
4
+ version: 0.3.13
5
5
  ---
6
6
 
7
7
  # AlphaFox shared Agent contract
@@ -14,7 +14,7 @@ Co-versioned with `@alphafox/cli`. Query compatibility with `alphafox version --
14
14
 
15
15
  Prefer the wizard (CLI + Agent Skills) or the Agent install guide. Do not treat
16
16
  `npm install -g @alphafox/cli` as enough for Agents — Skills must be registered
17
- with `alphafox skills sync`.
17
+ with `alphafox skills sync` (canonical store plus `~/.claude/skills` links).
18
18
 
19
19
  ```bash
20
20
  npx @alphafox/cli@latest install
@@ -24,6 +24,15 @@ npx @alphafox/cli version --format json --no-input
24
24
  npx @alphafox/cli doctor --format json --no-input
25
25
  ```
26
26
 
27
+ Uninstall is **not** `alphafox uninstall`. After an explicit user request:
28
+
29
+ ```bash
30
+ curl -fsSL https://raw.githubusercontent.com/alphafoxai/alphafox-cli/main/scripts/uninstall.cjs | node -- --dry-run
31
+ curl -fsSL https://raw.githubusercontent.com/alphafoxai/alphafox-cli/main/scripts/uninstall.cjs | node -- --yes
32
+ ```
33
+
34
+ After install, `auth status --verify` shows `session: active`, and the AI tool has restarted, follow skill `alphafox` **After install** (Lite square 带单员 + classic strategies). Do not skip that welcome.
35
+
27
36
  The CLI checks npm at most once every 24 hours and only prints a notice on
28
37
  **stderr**. It never auto-upgrades. If you see
29
38
  `[alphafox] update available` (or `updateAvailable: true`), ask the user:
@@ -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.11
4
+ version: 0.3.13
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.11
4
+ version: 0.3.13
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.
4
- version: 0.3.11
4
+ version: 0.3.13
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.11
4
+ version: 0.3.13
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.11
4
+ version: 0.3.13
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.11
4
+ version: 0.3.13
5
5
  ---
6
6
 
7
7
  # Notification
@@ -1,18 +1,22 @@
1
1
  ---
2
2
  name: alphafox-strategy
3
- description: Strategy definitions — list types (grid, dca, copy, …) and validate config. Creating a running strategy is creating a trader; use alphafox-trading for that.
4
- version: 0.3.11
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.13
5
5
  ---
6
6
 
7
7
  # Strategy definitions
8
8
 
9
9
  Always `--format json --no-input`. Read scopes `trading:read`; validate is `trading:write`.
10
10
 
11
- A **definition** is a strategy type (grid, dca, copy, …). A **trader** is one running instance of a definition. Instantiating a definition is `alphafox-trading`, not this skill.
11
+ A **definition** is a strategy type. A **trader** is one running instance. Instantiating is `alphafox-trading`. Local wasm backtest is `alphafox-engine-backtest`. This skill only discovers types and checks config.
12
12
 
13
- Whenever the human names a ticker (US stock, coin, or contract), resolve it with `alphafox resolve-symbols` (`skills/market`) before writing symbols into a config you later validate or hand to create. 美股 are equity perps in `binance_perp_usdt` (`NVDA/USDT:USDT`, `assetClass=equity_perp`) — do not swap them for a crypto coin.
13
+ Human-named tickers go through `alphafox resolve-symbols` (`skills/market`) before they enter a config you later validate or hand to create. 美股 are equity perps in `binance_perp_usdt` (`NVDA/USDT:USDT`, `assetClass=equity_perp`).
14
14
 
15
- ## Read
15
+ Do not enumerate engine strategy IDs in this file. Pick the definition from `list` / `byId.get`. Do not add a wizard command. Do not invent a second catalog.
16
+
17
+ ## Discover
18
+
19
+ `trading.strategy_definitions.list` returns **active** rows only. Hidden types (including Hyperliquid / rebate copy) are absent from list; `byId.get` and `validate_config` still work when the operator named that id. Creation of those copy variants is `alphafox-trading` (`trading.hl_copy_traders.create` / `trading.rebate_copy_traders.create`).
16
20
 
17
21
  ```bash
18
22
  alphafox schema trading.strategy_definitions.list --format json --no-input
@@ -20,18 +24,51 @@ alphafox api GET /api/v1/trading/strategy-definitions --format json --no-input
20
24
  alphafox trading strategy_definitions byId get --definitionId <id> --format json --no-input
21
25
  ```
22
26
 
23
- Use the list to pick the definition the operator named. Copy / rebate-copy / DCA / grid are rows in this catalog, not a separate product.
27
+ Match the name the operator used against list `id` / `name` / `display`. If they already gave an id that list omitted, `byId.get` that id. Copy / DCA / grid are catalog rows, not separate products.
28
+
29
+ `byId.get` is the operator model. Read, in order:
30
+
31
+ 1. `id`, `category` (`COPY` / `DCA` / `GRID` / `TREND` / `OTHERS`), `status`
32
+ 2. English `description` (mechanism). Prefer it over marketing `display.description`
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
35
+ 5. `capabilities.actionDefinitions` (what a manual action changes)
36
+
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
+
39
+ ## Configure with the human
40
+
41
+ The human answers knobs. You write JSON.
42
+
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.
45
+ 3. Write `strategy-config.json` as:
46
+
47
+ ```json
48
+ {
49
+ "configSchemaVersion": 4,
50
+ "config": {
51
+ "common": {},
52
+ "strategy": {}
53
+ }
54
+ }
55
+ ```
56
+
57
+ `configSchemaVersion` comes from the definition (`configSchemaVersion` on `byId.get` / list). Omit it only when the schema says it is optional; when present it must match the definition. `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`.
58
+
59
+ 4. Keys and enums come from the definition schema, not from this skill. Do not ship a default `grid.json` / `dca.json`.
24
60
 
25
61
  ## Validate config
26
62
 
27
- Read `request.body` first. Do not invent definition or config fields.
63
+ Read `alphafox schema trading.strategy_definitions.byId.validate_config` first. Catalog `request.body` may look like a free `JsonObject`; still send the envelope above. The server checks the definition schema.
28
64
 
29
65
  ```bash
30
- alphafox schema trading.strategy_definitions.byId.validate_config --format json --no-input
31
66
  alphafox trading strategy_definitions byId validate_config --definitionId <id> --config @./strategy-config.json --format json --no-input
32
67
  ```
33
68
 
34
- After the config validates, create the running instance with `alphafox-trading`.
69
+ `body_schema` / `body_schema_missing` (exit `64`): re-read the operation schema. Server field-path errors: fix that path. Do not retry with a different envelope.
70
+
71
+ After it validates: create with `alphafox-trading`, or backtest with `alphafox-engine-backtest`. Do not create or backtest from this skill.
35
72
 
36
73
  ## operationIds
37
74
 
@@ -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.
4
- version: 0.3.11
4
+ version: 0.3.13
5
5
  ---
6
6
 
7
7
  # Running strategies (traders)