@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.
- package/README.md +31 -4
- package/dist/index.d.ts +1 -0
- package/dist/install/types.d.ts +2 -0
- package/dist/install/wizard.js +3 -26
- package/dist/skills/agent-links.d.ts +29 -0
- package/dist/skills/agent-links.js +217 -0
- package/dist/skills/manager.d.ts +8 -0
- package/dist/skills/manager.js +1 -0
- package/dist/skills/run-command.js +23 -6
- package/dist/skills-manifest.json +41 -41
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/alphafox-cli-installation-guide.md +29 -2
- package/docs/release-supply-chain.md +4 -4
- package/package.json +2 -1
- package/scripts/uninstall.cjs +438 -0
- package/skills/account/SKILL.md +1 -1
- package/skills/admin/SKILL.md +1 -1
- package/skills/alphafox/SKILL.md +59 -5
- package/skills/alphafox-shared/SKILL.md +11 -2
- 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 +46 -9
- package/skills/trading/SKILL.md +1 -1
|
@@ -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.
|
|
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:
|
package/skills/auth/SKILL.md
CHANGED
package/skills/cache/SKILL.md
CHANGED
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.13
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Market
|
package/skills/strategy/SKILL.md
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: alphafox-strategy
|
|
3
|
-
description: Strategy definitions — list types
|
|
4
|
-
version: 0.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.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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 `
|
|
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
|
-
|
|
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
|
|
package/skills/trading/SKILL.md
CHANGED