@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
@@ -2,33 +2,36 @@ import { executeRapidXCapability, findCapabilityById, normalizeUnknownError, pub
2
2
  import { writeCliAudit } from "../audit.js";
3
3
  import { fail, ok } from "../envelope.js";
4
4
  import { enforceCliPreviewGate } from "./trade-gate.js";
5
- const ACCOUNT_CAPABILITY_BY_ACTION = {
6
- overview: "account.overview",
7
- balance: "account.balance",
8
- "set-position-mode": "account.set-position-mode"
5
+ const PORTFOLIO_CAPABILITY_BY_ACTION = {
6
+ overview: "portfolio.overview",
7
+ assets: "portfolio.assets",
8
+ statement: "portfolio.statement",
9
+ "user-fee-rate": "portfolio.user-fee-rate",
10
+ "position-bracket": "portfolio.position-bracket",
11
+ "set-position-mode": "portfolio.set-position-mode"
9
12
  };
10
- export async function runAccountCommand(action, input) {
11
- const capabilityId = ACCOUNT_CAPABILITY_BY_ACTION[action];
13
+ export async function runPortfolioCommand(action, input) {
14
+ const capabilityId = PORTFOLIO_CAPABILITY_BY_ACTION[action];
12
15
  if (!capabilityId) {
13
- return fail("RCLI12001", `Unknown account command: ${action}`, "FAIL", `rapidx account ${action}`);
16
+ return fail("RCLI12001", `Unknown portfolio command: ${action}`, "FAIL", `rapidx portfolio ${action}`);
14
17
  }
15
18
  const capability = findCapabilityById(capabilityId);
16
19
  if (!capability) {
17
- return fail("RCLI30002", `Missing capability: ${capabilityId}`, "FAIL", `rapidx account ${action}`);
20
+ return fail("RCLI30002", `Missing capability: ${capabilityId}`, "FAIL", `rapidx portfolio ${action}`);
18
21
  }
19
- const blocked = enforceCliPreviewGate(capability, input, `rapidx account ${action}`);
22
+ const blocked = enforceCliPreviewGate(capability, input, `rapidx portfolio ${action}`);
20
23
  if (blocked) {
21
24
  return blocked;
22
25
  }
23
26
  try {
24
27
  const data = await executeRapidXCapability(capabilityId, input);
25
28
  const auditId = capability.operationType === "TRADE_WRITE"
26
- ? writeCliAudit("trade-write", "PASS", { command: `rapidx account ${action}`, capabilityId })
29
+ ? writeCliAudit("trade-write", "PASS", { command: `rapidx portfolio ${action}`, capabilityId })
27
30
  : undefined;
28
- return ok(data, `rapidx account ${action}`, "PASS", "real_tool_call", auditId);
31
+ return ok(data, `rapidx portfolio ${action}`, "PASS", "real_tool_call", auditId);
29
32
  }
30
33
  catch (error) {
31
34
  const productError = normalizeUnknownError(error, "RCLI01001");
32
- return fail(productError.code.replace(/^RCORE/, "RCLI"), productError.message, productError.status, `rapidx account ${action}`, publicErrorDetails(productError));
35
+ return fail(productError.code.replace(/^RCORE/, "RCLI"), productError.message, productError.status, `rapidx portfolio ${action}`, publicErrorDetails(productError));
33
36
  }
34
37
  }
@@ -4,9 +4,10 @@ import { fail, ok } from "../envelope.js";
4
4
  import { enforceCliPreviewGate } from "./trade-gate.js";
5
5
  const ALGO_CAPABILITY_BY_ACTION = {
6
6
  place: "algo.place",
7
- amend: "algo.amend",
7
+ replace: "algo.replace",
8
8
  cancel: "algo.cancel",
9
- list: "algo.list"
9
+ "open-orders": "algo.open-orders",
10
+ query: "algo.query"
10
11
  };
11
12
  export async function runAlgoCommand(action, input) {
12
13
  const capabilityId = ALGO_CAPABILITY_BY_ACTION[action];
@@ -1,6 +1,6 @@
1
1
  import { checkInvocationMode } from "../invocation-checker.js";
2
2
  import { fail, ok } from "../envelope.js";
3
- import { runAccountCommand } from "./account.js";
3
+ import { runPortfolioCommand } from "./account.js";
4
4
  import { runAlgoCommand } from "./algo.js";
5
5
  import { runAuthCheck } from "./auth.js";
6
6
  import { runConfigCommand } from "./config.js";
@@ -54,20 +54,20 @@ export async function dispatchCli(parsed) {
54
54
  if (domain === "market") {
55
55
  return runMarketCommand(action ?? "get-ticker", parsed.input);
56
56
  }
57
- if (domain === "account") {
58
- return runAccountCommand(action ?? "overview", parsed.input);
57
+ if (domain === "portfolio") {
58
+ return runPortfolioCommand(action ?? "overview", parsed.input);
59
59
  }
60
60
  if (domain === "order") {
61
- return runOrderCommand(action ?? "list", parsed.input);
61
+ return runOrderCommand(action ?? "open-orders", parsed.input);
62
62
  }
63
63
  if (domain === "trade") {
64
64
  return runTradeCommand(action ?? "preview", parsed.input);
65
65
  }
66
66
  if (domain === "position") {
67
- return runPositionCommand(action ?? "list", parsed.input);
67
+ return runPositionCommand(action ?? "query", parsed.input);
68
68
  }
69
69
  if (domain === "algo") {
70
- return runAlgoCommand(subAction ?? action ?? "list", parsed.input);
70
+ return runAlgoCommand(subAction ?? action ?? "open-orders", parsed.input);
71
71
  }
72
72
  return fail("RCLI12001", `Unknown command: ${parsed.command}`);
73
73
  }
@@ -73,8 +73,8 @@ export async function runOrderCommand(action, input) {
73
73
  }
74
74
  }
75
75
  function previewTargetForAction(action) {
76
- if (action === "amend-preview") {
77
- return "order.amend";
76
+ if (action === "replace-preview") {
77
+ return "order.replace";
78
78
  }
79
79
  if (action === "cancel-preview") {
80
80
  return "order.cancel";
@@ -3,9 +3,11 @@ import { writeCliAudit } from "../audit.js";
3
3
  import { fail, ok } from "../envelope.js";
4
4
  import { enforceCliPreviewGate } from "./trade-gate.js";
5
5
  const POSITION_CAPABILITY_BY_ACTION = {
6
- list: "position.list",
6
+ query: "position.query",
7
7
  history: "position.history",
8
+ "get-leverage": "position.get-leverage",
8
9
  close: "position.close",
10
+ "close-all": "position.close-all",
9
11
  "set-leverage": "position.set-leverage"
10
12
  };
11
13
  export async function runPositionCommand(action, input) {
@@ -13,6 +13,9 @@ export async function runUpdateCommand(action, input) {
13
13
  if (typeof input.maxCacheAgeSeconds === "number") {
14
14
  updateInput.maxCacheAgeSeconds = input.maxCacheAgeSeconds;
15
15
  }
16
+ if (typeof input.installedSkillsVersion === "string") {
17
+ updateInput.installedSkillsVersion = input.installedSkillsVersion;
18
+ }
16
19
  const result = await checkForUpdate(updateInput);
17
20
  return ok(result, "rapidx update check --json", envelopeStatusForUpdate(result.status));
18
21
  }
package/dist/cli/help.js CHANGED
@@ -18,7 +18,7 @@ export function formatCliHelp() {
18
18
  "",
19
19
  "Domains:",
20
20
  " schema, doctor, auth, config, update, self-check, invocation",
21
- " market, account, order, trade, position, algo",
21
+ " market, portfolio, order, trade, position, algo",
22
22
  "",
23
23
  "Use --input for structured JSON. Named options such as --symbol and --depth are also accepted for simple inputs."
24
24
  ].join("\n");
@@ -19,50 +19,65 @@ export async function executeRapidXCapability(capabilityId, input = {}, options
19
19
  }
20
20
  const client = options.client ?? new RapidXClient();
21
21
  switch (capabilityId) {
22
- case "account.overview":
22
+ case "portfolio.overview":
23
23
  return client.get("/api/v1/trading/account");
24
- case "account.balance":
25
- return executeAccountBalanceCapability(client, input);
26
- case "account.set-position-mode":
24
+ case "portfolio.assets":
25
+ return client.get("/api/v1/trading/portfolio/assets", optionalParams(input, ["exchangeType", "page", "pageSize"]));
26
+ case "portfolio.statement":
27
+ return client.get("/api/v1/trading/statement", statementParams(input));
28
+ case "portfolio.user-fee-rate":
29
+ return client.get("/api/v1/trading/userFeeRate");
30
+ case "portfolio.position-bracket":
31
+ return client.get("/api/v1/trading/positionBracket", symbolQueryParams(input));
32
+ case "portfolio.set-position-mode":
27
33
  return client.post("/api/v1/trading/account", {
28
34
  positionMode: String(input.mode),
29
35
  exchangeType: String(input.exchange)
30
36
  });
31
37
  case "order.place":
32
38
  return client.post("/api/v1/trading/order", orderPlaceBody(input));
33
- case "order.amend":
39
+ case "order.replace":
34
40
  return client.put("/api/v1/trading/order", orderAmendBody(input));
35
41
  case "order.cancel":
36
42
  return executeOrderCancelCapability(client, input);
37
- case "order.get":
43
+ case "order.cancel-all":
44
+ return client.delete("/api/v1/trading/cancelAll", cancelAllOrdersBody(input));
45
+ case "order.query":
38
46
  return client.get("/api/v1/trading/order", orderReadParams(input));
39
- case "order.list":
40
- return client.get("/api/v1/trading/orders", { pageSize: stringValue(input.pageSize, "1000"), ...optionalParams(input, ["symbol"]) });
47
+ case "order.open-orders":
48
+ return client.get("/api/v1/trading/orders", orderListParams(input, "1000"));
41
49
  case "order.history":
42
- return client.get("/api/v1/trading/history/orders", { pageSize: stringValue(input.pageSize, "100"), ...optionalParams(input, ["symbol", "startTime", "endTime"]) });
43
- case "position.list":
50
+ return client.get("/api/v1/trading/history/orders", orderListParams(input, "100"));
51
+ case "order.executions":
52
+ return client.get("/api/v1/trading/executions", executionParams(input));
53
+ case "position.query":
44
54
  return executePositionListCapability(client, input);
45
55
  case "position.history":
46
56
  return client.get("/api/v1/trading/history/position", {
47
57
  pageSize: stringValue(input.pageSize, "100"),
48
58
  ...positionHistoryParams(input)
49
59
  });
60
+ case "position.get-leverage":
61
+ return client.get("/api/v1/trading/perp/leverage", symbolQueryParams(input));
50
62
  case "position.close":
51
63
  return executePositionCloseCapability(client, input);
64
+ case "position.close-all":
65
+ return client.delete("/api/v1/trading/positions", closeAllPositionsBody(input));
52
66
  case "position.set-leverage":
53
67
  return client.post("/api/v1/trading/position/leverage", compactObject({
54
68
  sym: String(input.symbol),
55
- leverage: String(input.leverage),
56
- positionSide: input.positionSide
69
+ leverage: String(input.leverage)
57
70
  }));
58
71
  case "algo.place":
59
72
  return client.post("/api/v1/algo/order", algoPlaceBody(input));
60
- case "algo.amend":
73
+ case "algo.replace":
61
74
  return client.put("/api/v1/algo/order", algoAmendBody(input));
62
75
  case "algo.cancel":
63
76
  return client.delete("/api/v1/algo/order", optionalParams(input, ["algoOrderId", "clientOrderId"]));
64
- case "algo.list":
77
+ case "algo.open-orders":
65
78
  return client.get("/api/v1/algo/openOrders", algoListParams(input));
79
+ case "algo.query":
80
+ return client.get("/api/v1/algo/order", optionalParams(input, ["algoOrderId", "clientOrderId", "attachedOrderId"]));
66
81
  default:
67
82
  throw new ProductError({
68
83
  code: "RCORE30002",
@@ -133,14 +148,6 @@ async function executeMarketCapability(capabilityId, input, fetchFn) {
133
148
  throw new ProductError({ code: "RCORE30002", status: "FAIL", message: `Unknown market capability: ${capabilityId}` });
134
149
  }
135
150
  }
136
- function executeAccountBalanceCapability(client, input) {
137
- const mode = String(input.mode ?? "portfolio").toLowerCase();
138
- const params = optionalParams(input, ["currency"]);
139
- if (mode === "account") {
140
- return client.get("/api/v1/account/balance", params);
141
- }
142
- return client.get("/api/v1/trading/portfolio/assets", params);
143
- }
144
151
  async function executePositionListCapability(client, input) {
145
152
  const params = {};
146
153
  if (input.symbol !== undefined && input.symbol !== null && input.symbol !== "") {
@@ -160,7 +167,7 @@ async function executePositionCloseCapability(client, input) {
160
167
  positionSide: input.positionSide,
161
168
  maxNotional: input.maxNotional
162
169
  }),
163
- readbackNote: "position.close uses RapidX close-position API; order.get reduceOnly may not reflect this close-position request. Verify final exposure with position.list.",
170
+ readbackNote: "position.close uses RapidX close-position API; order.query reduceOnly may not reflect this close-position request. Verify final exposure with position.query.",
164
171
  response
165
172
  };
166
173
  }
@@ -173,8 +180,8 @@ async function executeOrderCancelCapability(client, input) {
173
180
  terminalStateConfirmed,
174
181
  ...compactObject({ lastObservedOrderState }),
175
182
  recommendedAction: terminalStateConfirmed
176
- ? "verify final status with order/get or order/list when needed"
177
- : "poll order/get until CANCELED, REJECTED, EXPIRED, or timeout",
183
+ ? "verify final status with order/query or order/open-orders when needed"
184
+ : "poll order/query until CANCELED, REJECTED, EXPIRED, or timeout",
178
185
  response
179
186
  };
180
187
  }
@@ -286,9 +293,59 @@ function orderCancelBody(input) {
286
293
  assertValidOrderId(input.orderId);
287
294
  return optionalParams(input, ["orderId", "clientOrderId"]);
288
295
  }
296
+ function cancelAllOrdersBody(input) {
297
+ const body = optionalParams(input, ["exchangeType"]);
298
+ if (input.symbol !== undefined && input.symbol !== null && input.symbol !== "") {
299
+ body.sym = String(input.symbol);
300
+ }
301
+ return body;
302
+ }
289
303
  function orderReadParams(input) {
290
304
  assertOrderLookupReference(input);
291
- return optionalParams(input, ["orderId", "clientOrderId", "symbol"]);
305
+ return {
306
+ ...optionalParams(input, ["orderId", "clientOrderId"]),
307
+ ...symbolQueryParams(input)
308
+ };
309
+ }
310
+ function orderListParams(input, defaultPageSize) {
311
+ return {
312
+ pageSize: stringValue(input.pageSize, defaultPageSize),
313
+ ...mappedOptionalParams(input, [
314
+ ["symbol", "sym"],
315
+ ["exchange", "exchange"],
316
+ ["businessType", "businessType"],
317
+ ["startTime", "begin"],
318
+ ["endTime", "end"],
319
+ ["page", "page"],
320
+ ["filterExecuted", "filterExecuted"]
321
+ ])
322
+ };
323
+ }
324
+ function executionParams(input) {
325
+ return mappedOptionalParams(input, [
326
+ ["orderId", "orderId"],
327
+ ["symbol", "sym"],
328
+ ["exchange", "exchange"],
329
+ ["businessType", "businessType"],
330
+ ["startTime", "begin"],
331
+ ["endTime", "end"],
332
+ ["limit", "limit"]
333
+ ]);
334
+ }
335
+ function statementParams(input) {
336
+ return mappedOptionalParams(input, [
337
+ ["coin", "coin"],
338
+ ["symbol", "sym"],
339
+ ["statementType", "statementType"],
340
+ ["exchange", "exchange"],
341
+ ["startTime", "startTime"],
342
+ ["endTime", "endTime"],
343
+ ["page", "page"],
344
+ ["pageSize", "pageSize"]
345
+ ]);
346
+ }
347
+ function symbolQueryParams(input) {
348
+ return mappedOptionalParams(input, [["symbol", "sym"]]);
292
349
  }
293
350
  function positionCloseBody(input) {
294
351
  const body = {
@@ -299,6 +356,14 @@ function positionCloseBody(input) {
299
356
  }
300
357
  return body;
301
358
  }
359
+ function closeAllPositionsBody(input) {
360
+ return compactObject({
361
+ symList: input.symbolList,
362
+ positionSide: input.positionSide,
363
+ closeAllPos: input.closeAllPositions === undefined ? undefined : input.closeAllPositions === true ? "true" : "false",
364
+ exchangeType: input.exchangeType
365
+ });
366
+ }
302
367
  function algoPlaceBody(input) {
303
368
  const body = {
304
369
  ...orderPlaceBody(input),
@@ -329,14 +394,21 @@ function algoAmendBody(input) {
329
394
  return body;
330
395
  }
331
396
  function algoListParams(input) {
332
- const params = {};
333
- if (input.symbol !== undefined && input.symbol !== null && input.symbol !== "") {
334
- params.sym = String(input.symbol);
335
- }
336
- return params;
397
+ return mappedOptionalParams(input, [
398
+ ["symbol", "sym"],
399
+ ["exchange", "exchange"],
400
+ ["businessType", "businessType"],
401
+ ["startTime", "begin"],
402
+ ["endTime", "end"],
403
+ ["page", "page"],
404
+ ["pageSize", "pageSize"]
405
+ ]);
337
406
  }
338
407
  function positionHistoryParams(input) {
339
- const params = optionalParams(input, ["startTime", "endTime"]);
408
+ const params = mappedOptionalParams(input, [
409
+ ["startTime", "begin"],
410
+ ["endTime", "end"]
411
+ ]);
340
412
  if (input.symbol !== undefined && input.symbol !== null && input.symbol !== "") {
341
413
  params.sym = String(input.symbol);
342
414
  }
@@ -469,6 +541,11 @@ function appendMappedOptionalParams(target, input, mappings) {
469
541
  }
470
542
  }
471
543
  }
544
+ function mappedOptionalParams(input, mappings) {
545
+ const result = {};
546
+ appendMappedOptionalParams(result, input, mappings);
547
+ return result;
548
+ }
472
549
  function omitKeys(input, keys) {
473
550
  const blocked = new Set(keys);
474
551
  return Object.fromEntries(Object.entries(input).filter(([key]) => !blocked.has(key)));
@@ -65,12 +65,11 @@ export class RapidXClient {
65
65
  await delay(this.readOnlyRetryDelayMs * (2 ** (attempt - 1)));
66
66
  continue;
67
67
  }
68
- const hint = upstreamHttpErrorHint(path, response.status, text);
69
68
  throw new ProductError({
70
- code: upstreamHttpErrorCode(path, response.status, text),
71
- status: upstreamHttpErrorStatus(path, response.status, text),
72
- message: hint ? `RapidX upstream error ${response.status}. ${hint}` : `RapidX upstream error ${response.status}`,
73
- details: { upstreamStatus: response.status, status: response.status, body: text.slice(0, 500), attempts: attempt, ...(hint ? { hint } : {}) }
69
+ code: upstreamHttpErrorCode(response.status),
70
+ status: upstreamHttpErrorStatus(response.status),
71
+ message: `RapidX upstream error ${response.status}`,
72
+ details: { upstreamStatus: response.status, status: response.status, body: text.slice(0, 500), attempts: attempt }
74
73
  });
75
74
  }
76
75
  if (!text) {
@@ -111,16 +110,7 @@ function resolveBaseUrl(explicitBaseUrl) {
111
110
  function firstNonEmpty(...values) {
112
111
  return values.find((value) => value !== undefined && value.length > 0);
113
112
  }
114
- function upstreamHttpErrorHint(path, status, body) {
115
- if (isAccountBalanceScopeError(path, status, body)) {
116
- return "account balance mode=account requires account-level credentials; portfolio keys should use mode=portfolio.";
117
- }
118
- return undefined;
119
- }
120
- function upstreamHttpErrorCode(path, status, body) {
121
- if (isAccountBalanceScopeError(path, status, body)) {
122
- return CORE_ERRORS.PERMISSION_SCOPE_ERROR;
123
- }
113
+ function upstreamHttpErrorCode(status) {
124
114
  if (status === 404) {
125
115
  return CORE_ERRORS.NOT_FOUND;
126
116
  }
@@ -132,28 +122,12 @@ function upstreamHttpErrorCode(path, status, body) {
132
122
  }
133
123
  return CORE_ERRORS.INVALID_CREDENTIAL;
134
124
  }
135
- function upstreamHttpErrorStatus(path, status, body) {
136
- if (isAccountBalanceScopeError(path, status, body)) {
137
- return "PERMISSION_SCOPE_ERROR";
138
- }
125
+ function upstreamHttpErrorStatus(status) {
139
126
  if (status === 404) {
140
127
  return "NOT_FOUND";
141
128
  }
142
129
  return "FAIL";
143
130
  }
144
- function isAccountBalanceScopeError(path, status, body) {
145
- if (path !== "/api/v1/account/balance" || status < 400) {
146
- return false;
147
- }
148
- if (status >= 500) {
149
- return true;
150
- }
151
- const lowerBody = body.toLowerCase();
152
- return lowerBody.includes("account-level")
153
- || lowerBody.includes("permission scope")
154
- || lowerBody.includes("credential scope")
155
- || (lowerBody.includes("portfolio") && lowerBody.includes("account"));
156
- }
157
131
  function delay(ms) {
158
132
  if (ms <= 0) {
159
133
  return Promise.resolve();
@@ -17,28 +17,36 @@ export const CAPABILITIES = [
17
17
  { capabilityId: "market.mark-price", cliCommand: "rapidx market get-mark-price", mcpTool: "rapidx/market/get-mark-price", operationType: "READ", riskLevel: "read", inputSchema: "SymbolInput", outputSchema: "MarkPrice", previewRequired: false },
18
18
  { capabilityId: "market.symbol-info", cliCommand: "rapidx market get-symbol-info", mcpTool: "rapidx/market/get-symbol-info", operationType: "READ", riskLevel: "read", inputSchema: "SymbolInput", outputSchema: "SymbolInfo", previewRequired: false },
19
19
  { capabilityId: "market.open-interest", cliCommand: "rapidx market get-open-interest", mcpTool: "rapidx/market/get-open-interest", operationType: "READ", riskLevel: "read", inputSchema: "SymbolInput", outputSchema: "OpenInterest", previewRequired: false },
20
- { capabilityId: "account.overview", cliCommand: "rapidx account overview", mcpTool: "rapidx/account/overview", operationType: "TRADE_READ", riskLevel: "trade-read", inputSchema: "EmptyInput", outputSchema: "AccountOverview", previewRequired: false },
21
- { capabilityId: "account.balance", cliCommand: "rapidx account balance", mcpTool: "rapidx/account/balance", operationType: "TRADE_READ", riskLevel: "trade-read", inputSchema: "AccountBalanceInput", outputSchema: "AccountBalance", previewRequired: false },
22
- { capabilityId: "account.set-position-mode", cliCommand: "rapidx account set-position-mode", mcpTool: "rapidx/account/set-position-mode", operationType: "TRADE_WRITE", riskLevel: "critical-trade-write", inputSchema: "SetPositionModeInput", outputSchema: "SetPositionModeResult", previewRequired: true },
20
+ { capabilityId: "portfolio.overview", cliCommand: "rapidx portfolio overview", mcpTool: "rapidx/portfolio/overview", operationType: "TRADE_READ", riskLevel: "trade-read", inputSchema: "EmptyInput", outputSchema: "PortfolioOverview", previewRequired: false },
21
+ { capabilityId: "portfolio.assets", cliCommand: "rapidx portfolio assets", mcpTool: "rapidx/portfolio/assets", operationType: "TRADE_READ", riskLevel: "trade-read", inputSchema: "PortfolioAssetsInput", outputSchema: "PortfolioAssets", previewRequired: false },
22
+ { capabilityId: "portfolio.statement", cliCommand: "rapidx portfolio statement", mcpTool: "rapidx/portfolio/statement", operationType: "TRADE_READ", riskLevel: "trade-read", inputSchema: "StatementInput", outputSchema: "StatementResult", previewRequired: false },
23
+ { capabilityId: "portfolio.user-fee-rate", cliCommand: "rapidx portfolio user-fee-rate", mcpTool: "rapidx/portfolio/user-fee-rate", operationType: "TRADE_READ", riskLevel: "trade-read", inputSchema: "EmptyInput", outputSchema: "UserFeeRate", previewRequired: false },
24
+ { capabilityId: "portfolio.position-bracket", cliCommand: "rapidx portfolio position-bracket", mcpTool: "rapidx/portfolio/position-bracket", operationType: "TRADE_READ", riskLevel: "trade-read", inputSchema: "PositionBracketInput", outputSchema: "PositionBracket", previewRequired: false },
25
+ { capabilityId: "portfolio.set-position-mode", cliCommand: "rapidx portfolio set-position-mode", mcpTool: "rapidx/portfolio/set-position-mode", operationType: "TRADE_WRITE", riskLevel: "critical-trade-write", inputSchema: "SetPositionModeInput", outputSchema: "SetPositionModeResult", previewRequired: true },
23
26
  { capabilityId: "trade.preview", cliCommand: "rapidx trade preview", mcpTool: "rapidx/trade/preview", operationType: "TRADE_WRITE", riskLevel: "trade-write", inputSchema: "TradePreviewInput", outputSchema: "TradePreviewResult", previewRequired: false },
24
27
  { capabilityId: "order.preview", cliCommand: "rapidx order preview", mcpTool: "rapidx/order/preview", operationType: "TRADE_WRITE", riskLevel: "trade-write", inputSchema: "PreviewOrderInput", outputSchema: "PreviewOrderResult", previewRequired: false },
25
28
  { capabilityId: "order.place-preview", cliCommand: "rapidx order place-preview", mcpTool: "rapidx/order/place-preview", operationType: "TRADE_WRITE", riskLevel: "trade-write", inputSchema: "PreviewOrderInput", outputSchema: "PreviewOrderResult", previewRequired: false },
26
- { capabilityId: "order.amend-preview", cliCommand: "rapidx order amend-preview", mcpTool: "rapidx/order/amend-preview", operationType: "TRADE_WRITE", riskLevel: "trade-write", inputSchema: "AmendOrderPreviewInput", outputSchema: "TradePreviewResult", previewRequired: false },
29
+ { capabilityId: "order.replace-preview", cliCommand: "rapidx order replace-preview", mcpTool: "rapidx/order/replace-preview", operationType: "TRADE_WRITE", riskLevel: "trade-write", inputSchema: "ReplaceOrderPreviewInput", outputSchema: "TradePreviewResult", previewRequired: false },
27
30
  { capabilityId: "order.cancel-preview", cliCommand: "rapidx order cancel-preview", mcpTool: "rapidx/order/cancel-preview", operationType: "TRADE_WRITE", riskLevel: "trade-write", inputSchema: "CancelOrderPreviewInput", outputSchema: "TradePreviewResult", previewRequired: false },
28
31
  { capabilityId: "order.place", cliCommand: "rapidx order place", mcpTool: "rapidx/order/place", operationType: "TRADE_WRITE", riskLevel: "trade-write", inputSchema: "PlaceOrderInput", outputSchema: "OrderStatusResult", previewRequired: true },
29
- { capabilityId: "order.amend", cliCommand: "rapidx order amend", mcpTool: "rapidx/order/amend", operationType: "TRADE_WRITE", riskLevel: "trade-write", inputSchema: "AmendOrderInput", outputSchema: "OrderStatusResult", previewRequired: true },
32
+ { capabilityId: "order.replace", cliCommand: "rapidx order replace", mcpTool: "rapidx/order/replace", operationType: "TRADE_WRITE", riskLevel: "trade-write", inputSchema: "ReplaceOrderInput", outputSchema: "OrderStatusResult", previewRequired: true },
30
33
  { capabilityId: "order.cancel", cliCommand: "rapidx order cancel", mcpTool: "rapidx/order/cancel", operationType: "TRADE_WRITE", riskLevel: "trade-write", inputSchema: "CancelOrderInput", outputSchema: "OrderStatusResult", previewRequired: true },
31
- { capabilityId: "order.get", cliCommand: "rapidx order get", mcpTool: "rapidx/order/get", operationType: "TRADE_READ", riskLevel: "trade-read", inputSchema: "OrderLookupInput", outputSchema: "OrderStatusResult", previewRequired: false },
32
- { capabilityId: "order.list", cliCommand: "rapidx order list", mcpTool: "rapidx/order/list", operationType: "TRADE_READ", riskLevel: "trade-read", inputSchema: "OrderListInput", outputSchema: "OrderList", previewRequired: false },
34
+ { capabilityId: "order.cancel-all", cliCommand: "rapidx order cancel-all", mcpTool: "rapidx/order/cancel-all", operationType: "TRADE_WRITE", riskLevel: "critical-trade-write", inputSchema: "CancelAllOrdersInput", outputSchema: "CancelAllOrdersResult", previewRequired: true },
35
+ { capabilityId: "order.query", cliCommand: "rapidx order query", mcpTool: "rapidx/order/query", operationType: "TRADE_READ", riskLevel: "trade-read", inputSchema: "OrderLookupInput", outputSchema: "OrderStatusResult", previewRequired: false },
36
+ { capabilityId: "order.open-orders", cliCommand: "rapidx order open-orders", mcpTool: "rapidx/order/open-orders", operationType: "TRADE_READ", riskLevel: "trade-read", inputSchema: "OrderListInput", outputSchema: "OrderList", previewRequired: false },
33
37
  { capabilityId: "order.history", cliCommand: "rapidx order history", mcpTool: "rapidx/order/history", operationType: "TRADE_READ", riskLevel: "trade-read", inputSchema: "OrderHistoryInput", outputSchema: "OrderHistory", previewRequired: false },
34
- { capabilityId: "position.list", cliCommand: "rapidx position list", mcpTool: "rapidx/position/list", operationType: "TRADE_READ", riskLevel: "trade-read", inputSchema: "PositionListInput", outputSchema: "PositionList", previewRequired: false },
38
+ { capabilityId: "order.executions", cliCommand: "rapidx order executions", mcpTool: "rapidx/order/executions", operationType: "TRADE_READ", riskLevel: "trade-read", inputSchema: "ExecutionListInput", outputSchema: "ExecutionList", previewRequired: false },
39
+ { capabilityId: "position.query", cliCommand: "rapidx position query", mcpTool: "rapidx/position/query", operationType: "TRADE_READ", riskLevel: "trade-read", inputSchema: "PositionListInput", outputSchema: "PositionList", previewRequired: false },
35
40
  { capabilityId: "position.history", cliCommand: "rapidx position history", mcpTool: "rapidx/position/history", operationType: "TRADE_READ", riskLevel: "trade-read", inputSchema: "PositionHistoryInput", outputSchema: "PositionHistory", previewRequired: false },
41
+ { capabilityId: "position.get-leverage", cliCommand: "rapidx position get-leverage", mcpTool: "rapidx/position/get-leverage", operationType: "TRADE_READ", riskLevel: "trade-read", inputSchema: "SymbolInput", outputSchema: "PositionLeverage", previewRequired: false },
36
42
  { capabilityId: "position.close", cliCommand: "rapidx position close", mcpTool: "rapidx/position/close", operationType: "TRADE_WRITE", riskLevel: "critical-trade-write", inputSchema: "ClosePositionInput", outputSchema: "ClosePositionResult", previewRequired: true },
43
+ { capabilityId: "position.close-all", cliCommand: "rapidx position close-all", mcpTool: "rapidx/position/close-all", operationType: "TRADE_WRITE", riskLevel: "critical-trade-write", inputSchema: "CloseAllPositionsInput", outputSchema: "CloseAllPositionsResult", previewRequired: true },
37
44
  { capabilityId: "position.set-leverage", cliCommand: "rapidx position set-leverage", mcpTool: "rapidx/position/set-leverage", operationType: "TRADE_WRITE", riskLevel: "critical-trade-write", inputSchema: "SetLeverageInput", outputSchema: "SetLeverageResult", previewRequired: true },
38
45
  { capabilityId: "algo.place", cliCommand: "rapidx algo place", mcpTool: "rapidx/algo/place", operationType: "TRADE_WRITE", riskLevel: "trade-write", inputSchema: "AlgoPlaceInput", outputSchema: "AlgoOrderStatus", previewRequired: true },
39
- { capabilityId: "algo.amend", cliCommand: "rapidx algo amend", mcpTool: "rapidx/algo/amend", operationType: "TRADE_WRITE", riskLevel: "trade-write", inputSchema: "AlgoAmendInput", outputSchema: "AlgoOrderStatus", previewRequired: true },
46
+ { capabilityId: "algo.replace", cliCommand: "rapidx algo replace", mcpTool: "rapidx/algo/replace", operationType: "TRADE_WRITE", riskLevel: "trade-write", inputSchema: "AlgoReplaceInput", outputSchema: "AlgoOrderStatus", previewRequired: true },
40
47
  { capabilityId: "algo.cancel", cliCommand: "rapidx algo cancel", mcpTool: "rapidx/algo/cancel", operationType: "TRADE_WRITE", riskLevel: "trade-write", inputSchema: "AlgoCancelInput", outputSchema: "AlgoOrderStatus", previewRequired: true },
41
- { capabilityId: "algo.list", cliCommand: "rapidx algo list", mcpTool: "rapidx/algo/list", operationType: "TRADE_READ", riskLevel: "trade-read", inputSchema: "AlgoListInput", outputSchema: "AlgoList", previewRequired: false },
48
+ { capabilityId: "algo.open-orders", cliCommand: "rapidx algo open-orders", mcpTool: "rapidx/algo/open-orders", operationType: "TRADE_READ", riskLevel: "trade-read", inputSchema: "AlgoListInput", outputSchema: "AlgoList", previewRequired: false },
49
+ { capabilityId: "algo.query", cliCommand: "rapidx algo query", mcpTool: "rapidx/algo/query", operationType: "TRADE_READ", riskLevel: "trade-read", inputSchema: "AlgoLookupInput", outputSchema: "AlgoOrderStatus", previewRequired: false },
42
50
  { capabilityId: "trading.verify", cliCommand: "rapidx self-check trade-verify", mcpTool: "rapidx/trading-verification", operationType: "TRADE_WRITE", riskLevel: "critical-trade-write", inputSchema: "TradingVerificationInput", outputSchema: "TradingVerificationReport", previewRequired: false, containsRealOrder: true, requiresExplicitHumanConfirmation: true, confirmationMode: "internal-preview-and-parameter-bound-consent" },
43
51
  { capabilityId: "trading.verify-live", cliCommand: "rapidx trade verify-live", mcpTool: "rapidx/trade/verify-live", operationType: "TRADE_WRITE", riskLevel: "critical-trade-write", inputSchema: "TradingVerificationInput", outputSchema: "TradingVerificationReport", previewRequired: false, containsRealOrder: true, requiresExplicitHumanConfirmation: true, confirmationMode: "internal-preview-and-parameter-bound-consent" },
44
52
  { capabilityId: "invocation.check", cliCommand: "rapidx invocation check", operationType: "DIAGNOSTIC", riskLevel: "read", inputSchema: "InvocationCheckInput", outputSchema: "InvocationCompliance", previewRequired: false }
@@ -1,7 +1,7 @@
1
1
  import { SCHEMA_VERSION } from "./types.js";
2
2
  import { RAPIDX_VERSION } from "../version.js";
3
3
  export const RAPIDX_SKILLS_DISTRIBUTION = "github";
4
- export const RAPIDX_SKILLS_VERSION = "1.0.5";
4
+ export const RAPIDX_SKILLS_VERSION = "1.0.8";
5
5
  export const RAPIDX_SKILLS_SCHEMA_VERSION = "1.0.0";
6
6
  export function buildCompatibilityReport(input = {}) {
7
7
  const checks = [