@liquiditytech/rapidx-cli 1.0.31 → 1.0.33

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.
Files changed (31) hide show
  1. package/dist/cli/commands/account.js +15 -12
  2. package/dist/cli/commands/algo.js +3 -2
  3. package/dist/cli/commands/index.js +6 -6
  4. package/dist/cli/commands/order.js +2 -2
  5. package/dist/cli/commands/position.js +3 -1
  6. package/dist/cli/commands/update.js +3 -0
  7. package/dist/cli/help.js +1 -1
  8. package/dist/core/client/capability-executor.js +109 -32
  9. package/dist/core/client/rapid-x-client.js +6 -32
  10. package/dist/core/contracts/capabilities.js +18 -10
  11. package/dist/core/contracts/compatibility.js +1 -1
  12. package/dist/core/contracts/input-schema.js +40 -14
  13. package/dist/core/safety/policy.js +9 -5
  14. package/dist/core/self-check/live-read-only-probes.js +4 -4
  15. package/dist/core/self-check/live-trading-verification-probes.js +3 -3
  16. package/dist/core/trading/preview-preflight.js +3 -3
  17. package/dist/core/trading/preview.js +2 -2
  18. package/dist/core/trading/trading-verification.js +8 -8
  19. package/dist/core/update/check-update.js +77 -10
  20. package/dist/core/version.js +1 -1
  21. package/dist/mcp/tool-runner.js +5 -2
  22. package/package.json +1 -1
  23. package/packages/distribution/docs/cli.md +36 -11
  24. package/packages/distribution/docs/mcp.md +4 -4
  25. package/packages/distribution/docs/quickstart.md +5 -5
  26. package/packages/distribution/docs/self-check.md +1 -1
  27. package/packages/distribution/docs/skills.md +1 -1
  28. package/packages/distribution/docs/tools.md +16 -14
  29. package/packages/distribution/docs/trading-verification.md +1 -1
  30. package/packages/distribution/manifests/offline-manifest.json +4 -4
  31. package/packages/distribution/registry/rapidx.mcp.json +1 -1
@@ -111,15 +111,15 @@ Do not treat a missing real call as success. The correct status is `NOT_VERIFIED
111
111
  rapidx schema --json
112
112
  ```
113
113
 
114
- For trade writes, create a preview before submit. Use `rapidx order place-preview` for `order.place`, `rapidx order amend-preview` for `order.amend`, and `rapidx order cancel-preview` for `order.cancel`. Use flat JSON with `rapidx trade preview` and `targetCapabilityId` for non-order writes such as `position.set-leverage`, `position.close`, or `account.set-position-mode`.
114
+ For trade writes, create a preview before submit. Use `rapidx order place-preview` for `order.place`, `rapidx order replace-preview` for `order.replace`, and `rapidx order cancel-preview` for `order.cancel`. Use flat JSON with `rapidx trade preview` and `targetCapabilityId` for non-order writes such as `position.set-leverage`, `position.close`, or `portfolio.set-position-mode`.
115
115
 
116
- `rapidx schema --json` and `rapidx/tools` return concrete `inputSchemas`. For hedge-mode orders, use `positionSide="LONG"` or `positionSide="SHORT"` in the order or verify-live input. Use `account.set-position-mode` only when the user explicitly asks to change account mode.
116
+ `rapidx schema --json` and `rapidx/tools` return concrete `inputSchemas`. For hedge-mode orders, use `positionSide="LONG"` or `positionSide="SHORT"` in the order or verify-live input. Use `portfolio.set-position-mode` only when the user explicitly asks to change account mode.
117
117
 
118
118
  For clearer order flows, prefer the explicit aliases:
119
119
 
120
120
  ```bash
121
121
  rapidx order place-preview --input '{"symbol":"BINANCE_PERP_BTC_USDT","side":"BUY","orderType":"LIMIT","price":"65000","quantity":"0.001","maxNotional":"100","clientOrderId":"example-001"}' --json
122
- rapidx order amend-preview --input '{"orderId":"<order-id>","price":"64900"}' --json
122
+ rapidx order replace-preview --input '{"orderId":"<order-id>","price":"64900"}' --json
123
123
  rapidx order cancel-preview --input '{"orderId":"<order-id>"}' --json
124
124
  rapidx trade preview --input '{"targetCapabilityId":"position.set-leverage","symbol":"BINANCE_PERP_BTC_USDT","leverage":5}' --json
125
125
  ```
@@ -128,10 +128,10 @@ When submitting the actual write, pass the returned `previewId` and use `confirm
128
128
 
129
129
  Preview ids are runtime-local. Submit MCP previews through the same MCP server runtime, and submit CLI previews through the same CLI preview store.
130
130
 
131
- `order.cancel` is asynchronous. If the cancel result says `terminalStateConfirmed=false`, poll `order get` until a terminal state before claiming that the order is cancelled.
131
+ `order.cancel` is asynchronous. If the cancel result says `terminalStateConfirmed=false`, poll `order query` until a terminal state before claiming that the order is cancelled.
132
132
 
133
133
  For automation, keep the preview-first flow. Use `automationMode=true` and the user's exact `automationConsentText` only after the user has enabled RapidX automation mode in chat for the current scope.
134
134
 
135
- `maxNotional` is a safety upper bound, not the target order amount. If a requested amount is below the symbol `minNotional`, ask the user to confirm the larger amount before submitting. For `position.close`, do not pass `side` or `quantity`; RapidX determines the close side from the current position and closes the target symbol/positionSide. Use a reduce-only order flow for partial closes, then check final exposure with `position list`.
135
+ `maxNotional` is a safety upper bound, not the target order amount. If a requested amount is below the symbol `minNotional`, ask the user to confirm the larger amount before submitting. For `position.close`, do not pass `side` or `quantity`; RapidX determines the close side from the current position and closes the target symbol/positionSide. Use a reduce-only order flow for partial closes, then check final exposure with `position query`.
136
136
 
137
137
  Use `rapidx trade verify-live --json` only when the user explicitly authorizes a small real-trade verification. Include `acceptedRiskText` that names the exact symbol, side, positionSide when provided, maxNotional, real-order risk, and cancel cleanup behavior. The older `rapidx self-check trade-verify --json` command remains supported for compatibility.
@@ -1,6 +1,6 @@
1
1
  # Self-check
2
2
 
3
- Read-only self-check verifies discovery, schema compatibility, public market access, credential auth, account or balance read, order list, and position list when probes are available.
3
+ Read-only self-check verifies discovery, schema compatibility, public market access, credential auth, portfolio assets, order open-orders, and position query when probes are available.
4
4
 
5
5
  The self-check must never submit an order.
6
6
 
@@ -137,4 +137,4 @@ The config skill guides the agent to install `@liquiditytech/rapidx-cli`, config
137
137
 
138
138
  The trading skill guides read flow, preview-first write flow, state confirmation, and small real-trade verification.
139
139
 
140
- For existing installations, run `rapidx update check --json` or call `rapidx/update/check` through MCP before an integration review. Reinstall the GitHub-distributed skills when the update result sets `skillsUpdateRecommended=true`.
140
+ For existing installations, read the installed skill `version` from each loaded `SKILL.md` frontmatter, then run `rapidx update check --input '{"installedSkillsVersion":"<local-skill-version>","force":true}' --json` or call `rapidx/update/check` through MCP with the same input before an integration review. Reinstall the GitHub-distributed skills when `skillsInstallStatus=UPDATE_AVAILABLE`, `installedSkillsVersion=NOT_VERIFIED`, or `skillsUpdateRecommended=true`.
@@ -12,17 +12,19 @@ The canonical source is `rapidx schema --json` or `rapidx/tools`.
12
12
 
13
13
  - `rapidx/order/preview`: preview for `order.place`.
14
14
  - `rapidx/order/place-preview`: explicit alias for `order.place` preview. It returns `previewId` plus `confirmation.submitToken`.
15
- - `rapidx/order/amend-preview`: explicit alias for `order.amend` preview. Submit `rapidx/order/amend` with unchanged parameters, `previewId`, and `continueConsentId=confirmation.submitToken`.
15
+ - `rapidx/order/replace-preview`: explicit alias for `order.replace` preview. Submit `rapidx/order/replace` with unchanged parameters, `previewId`, and `continueConsentId=confirmation.submitToken`.
16
16
  - `rapidx/order/cancel-preview`: explicit alias for `order.cancel` preview. Submit `rapidx/order/cancel` with unchanged parameters, `previewId`, and `continueConsentId=confirmation.submitToken`.
17
- - `rapidx/trade/preview`: generic preview for non-place trade writes, including position writes, account writes, and algo writes. Pass `targetCapabilityId`, then submit the target tool with unchanged parameters, `previewId`, and `continueConsentId`.
17
+ - `rapidx/trade/preview`: generic preview for non-place trade writes, including position writes, portfolio writes, and algo writes. Pass `targetCapabilityId`, then submit the target tool with unchanged parameters, `previewId`, and `continueConsentId`.
18
18
 
19
19
  ## Read Tools
20
20
 
21
21
  - Market reads: ticker, orderbook, klines, funding rate, mark price, symbol info, and open interest.
22
- - Account reads: overview and balance.
23
- - Order reads: get, list, and history.
24
- - Position reads: list and position history.
25
- - Algo reads: list.
22
+ - Portfolio reads: overview, assets, statement, user fee rate, and position bracket.
23
+ - Order reads: query, open-orders, history, and executions.
24
+ - Position reads: query, position history, and get-leverage.
25
+ - Algo reads: open-orders and query.
26
+
27
+ `open-orders` means current non-terminal orders, not "open an order". These orders may still be fillable, replaceable, or cancelable. `algo/open-orders` means current non-terminal algo orders such as conditional or TPSL orders that have not triggered, been canceled, or otherwise ended.
26
28
 
27
29
  ## Symbol Format
28
30
 
@@ -38,26 +40,26 @@ Public market adapters may call venue APIs with official venue symbols such as `
38
40
 
39
41
  ## Write Tools
40
42
 
41
- - Order writes: place, amend, and cancel.
42
- - Position writes: close and set leverage.
43
- - Account writes: set position mode.
44
- - Algo writes: place, amend, and cancel.
43
+ - Order writes: place, replace, cancel, and cancel-all.
44
+ - Position writes: close, close-all, and set leverage.
45
+ - Portfolio writes: set position mode.
46
+ - Algo writes: place, replace, and cancel.
45
47
  - Live verification: `rapidx/trade/verify-live` is the clearer alias for the small real-trade verification flow. It submits a real verification order and requires `acceptedRiskText` bound to the exact symbol, side, maxNotional, real-order risk, and cancel cleanup behavior. If `positionSide` is provided, `acceptedRiskText` must include it. `rapidx/trading-verification` remains supported for compatibility.
46
48
 
47
49
  All write tools require preview where the schema marks `previewRequired: true`.
48
50
  MARKET order writes are allowed after preview and consent. Preview includes immediate-execution and slippage risk notes; do not replace MARKET with a synthetic limit strategy unless the user explicitly asks for that order style.
49
51
 
50
- For hedge-mode order placement, pass `positionSide="LONG"` or `positionSide="SHORT"` on the order or verify-live input. Use `account.set-position-mode` only when the user explicitly asks to change the account position mode.
52
+ For hedge-mode order placement, pass `positionSide="LONG"` or `positionSide="SHORT"` on the order or verify-live input. Use `portfolio.set-position-mode` only when the user explicitly asks to change the account position mode.
51
53
 
52
54
  Preview ids are runtime-local. A preview created by MCP must be submitted through the same MCP server runtime. A preview created by CLI must be submitted through the same CLI preview store. Do not mix MCP preview ids with CLI submit commands, or the reverse.
53
55
 
54
- `order.cancel` is asynchronous. A successful cancel response means the cancel request was accepted; it may not prove a terminal order state yet. The response includes `cancelAccepted`, `terminalStateConfirmed`, `lastObservedOrderState`, and `recommendedAction`. Poll `order.get` until `CANCELED`, `REJECTED`, `EXPIRED`, or timeout when `terminalStateConfirmed=false`.
56
+ `order.cancel` is asynchronous. A successful cancel response means the cancel request was accepted; it may not prove a terminal order state yet. The response includes `cancelAccepted`, `terminalStateConfirmed`, `lastObservedOrderState`, and `recommendedAction`. Poll `order.query` until `CANCELED`, `REJECTED`, `EXPIRED`, or timeout when `terminalStateConfirmed=false`.
55
57
 
56
- Order identifiers use two validation layers. If `orderId` is provided, RapidX validates it locally as a 16-digit numeric id and returns `INVALID_INPUT` before any upstream call when the format is wrong. If `clientOrderId` is provided instead, do not apply `orderId` validation. For `order.get`, `order.amend-preview`, and `order.cancel-preview`, a syntactically valid `orderId` or `clientOrderId` is checked through RapidX readback; missing or non-open orders return `NOT_FOUND` or `BLOCKED` depending on the observed state.
58
+ Order identifiers use two validation layers. If `orderId` is provided, RapidX validates it locally as a 16-digit numeric id and returns `INVALID_INPUT` before any upstream call when the format is wrong. If `clientOrderId` is provided instead, do not apply `orderId` validation. For `order.query`, `order.replace-preview`, and `order.cancel-preview`, a syntactically valid `orderId` or `clientOrderId` is checked through RapidX readback; missing or non-open orders return `NOT_FOUND` or `BLOCKED` depending on the observed state.
57
59
 
58
60
  For automation, keep preview-first execution. Set `automationMode=true` and pass the user's exact `automationConsentText` only when the user has explicitly enabled RapidX automation mode in chat. The preview response still returns `confirmation.submitToken`; automation mode only means the agent may use that submit token without asking for another per-order chat confirmation within the authorized scope.
59
61
 
60
- For TPSL or conditional algo orders, use `rapidx/trade/preview` with `targetCapabilityId="algo.place"`, then submit `rapidx/algo/place`. `conditionType="ENTIRE_CLOSE_POSITION"` may use `orderType="MARKET"` without `quantity` or `amount`; provide at least one take-profit or stop-loss trigger and verify with `rapidx/algo/list`.
62
+ For TPSL or conditional algo orders, use `rapidx/trade/preview` with `targetCapabilityId="algo.place"`, then submit `rapidx/algo/place`. `conditionType="ENTIRE_CLOSE_POSITION"` may use `orderType="MARKET"` without `quantity` or `amount`; provide at least one take-profit or stop-loss trigger and verify with `rapidx/algo/open-orders`.
61
63
 
62
64
  ## Result Statuses
63
65
 
@@ -10,7 +10,7 @@ The expected flow is:
10
10
  4. internal preview with `maxNotional`
11
11
  5. post-only limit submit
12
12
  6. order query
13
- 7. amend when supported
13
+ 7. replace check when supported
14
14
  8. cancel
15
15
  9. cleanup-check
16
16
 
@@ -1,25 +1,25 @@
1
1
  {
2
- "version": "1.0.31",
2
+ "version": "1.0.33",
3
3
  "artifacts": [
4
4
  {
5
5
  "name": "rapidx-mcp-registry",
6
6
  "path": "packages/distribution/registry/rapidx.mcp.json",
7
7
  "channel": "offline",
8
- "checksum": "sha256:d3ee1491bd542f204e765f04ae98daa5970e0e32b8edd06ff5fab47189b20b6f",
8
+ "checksum": "sha256:a78b9c1ad3aa0df1f1e968e68c5ae30dbfcf39d4902e31973cbbfd0e306827ac",
9
9
  "status": "ready"
10
10
  },
11
11
  {
12
12
  "name": "rapidx-quickstart-doc",
13
13
  "path": "packages/distribution/docs/quickstart.md",
14
14
  "channel": "offline",
15
- "checksum": "sha256:f1771cbc6e3da39b47afac839ca89fc063bede11ac9d8078b215145953c0145c",
15
+ "checksum": "sha256:e7cb18db9ce37a94ff1489d951f23b5f0407fd9e1f28f47f8ec13681f5760ccc",
16
16
  "status": "ready"
17
17
  },
18
18
  {
19
19
  "name": "rapidx-tools-doc",
20
20
  "path": "packages/distribution/docs/tools.md",
21
21
  "channel": "offline",
22
- "checksum": "sha256:fc80e63eabc8407c74b01ed707187505c90497af53a25f201c07e13ef948bf18",
22
+ "checksum": "sha256:d7e378d95127c2c62bb8db3a58cfa8a5f80ab2cf523ee530144ddfb9cca7bd96",
23
23
  "status": "ready"
24
24
  }
25
25
  ]
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rapidx",
3
3
  "packageName": "@liquiditytech/rapidx-cli",
4
- "version": "1.0.31",
4
+ "version": "1.0.33",
5
5
  "command": "rapidx",
6
6
  "args": ["mcp", "serve"],
7
7
  "launchCommand": "rapidx",