@liquiditytech/rapidx-cli 1.0.26

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 (64) hide show
  1. package/README.md +81 -0
  2. package/dist/cli/audit.js +10 -0
  3. package/dist/cli/bin.js +41 -0
  4. package/dist/cli/commands/account.js +34 -0
  5. package/dist/cli/commands/algo.js +35 -0
  6. package/dist/cli/commands/auth.js +22 -0
  7. package/dist/cli/commands/config.js +46 -0
  8. package/dist/cli/commands/doctor.js +42 -0
  9. package/dist/cli/commands/index.js +73 -0
  10. package/dist/cli/commands/market.js +26 -0
  11. package/dist/cli/commands/order.js +81 -0
  12. package/dist/cli/commands/position.js +35 -0
  13. package/dist/cli/commands/schema.js +5 -0
  14. package/dist/cli/commands/self-check.js +24 -0
  15. package/dist/cli/commands/trade-gate.js +26 -0
  16. package/dist/cli/commands/trade.js +30 -0
  17. package/dist/cli/commands/update.js +27 -0
  18. package/dist/cli/envelope.js +29 -0
  19. package/dist/cli/help.js +34 -0
  20. package/dist/cli/invocation-checker.js +39 -0
  21. package/dist/cli/mcp-entry.js +4 -0
  22. package/dist/cli/parser.js +87 -0
  23. package/dist/core/audit/redaction.js +56 -0
  24. package/dist/core/audit/writer.js +27 -0
  25. package/dist/core/client/capability-executor.js +400 -0
  26. package/dist/core/client/rapid-x-client.js +156 -0
  27. package/dist/core/client/signing.js +24 -0
  28. package/dist/core/client/symbol.js +36 -0
  29. package/dist/core/config/credential.js +42 -0
  30. package/dist/core/config/resolve.js +24 -0
  31. package/dist/core/contracts/capabilities.js +77 -0
  32. package/dist/core/contracts/compatibility.js +65 -0
  33. package/dist/core/contracts/events.js +29 -0
  34. package/dist/core/contracts/evidence.js +7 -0
  35. package/dist/core/contracts/input-schema.js +370 -0
  36. package/dist/core/contracts/types.js +1 -0
  37. package/dist/core/errors/product-error.js +74 -0
  38. package/dist/core/index.js +24 -0
  39. package/dist/core/safety/policy.js +215 -0
  40. package/dist/core/safety/raw-api.js +19 -0
  41. package/dist/core/self-check/live-read-only-probes.js +25 -0
  42. package/dist/core/self-check/live-trading-verification-probes.js +252 -0
  43. package/dist/core/self-check/run-self-check.js +91 -0
  44. package/dist/core/trading/preview.js +330 -0
  45. package/dist/core/trading/trading-verification.js +137 -0
  46. package/dist/core/update/check-update.js +295 -0
  47. package/dist/core/version.js +1 -0
  48. package/dist/mcp/audit.js +10 -0
  49. package/dist/mcp/server.js +73 -0
  50. package/dist/mcp/tool-registry.js +31 -0
  51. package/dist/mcp/tool-runner.js +144 -0
  52. package/package.json +48 -0
  53. package/packages/distribution/docs/cli-only-agent.md +12 -0
  54. package/packages/distribution/docs/cli.md +49 -0
  55. package/packages/distribution/docs/index.md +58 -0
  56. package/packages/distribution/docs/mcp.md +36 -0
  57. package/packages/distribution/docs/quickstart.md +129 -0
  58. package/packages/distribution/docs/self-check.md +7 -0
  59. package/packages/distribution/docs/skills.md +140 -0
  60. package/packages/distribution/docs/tools.md +35 -0
  61. package/packages/distribution/docs/trading-verification.md +17 -0
  62. package/packages/distribution/docs/troubleshooting/index.md +27 -0
  63. package/packages/distribution/manifests/offline-manifest.json +26 -0
  64. package/packages/distribution/registry/rapidx.mcp.json +26 -0
@@ -0,0 +1,370 @@
1
+ import { ProductError } from "../errors/product-error.js";
2
+ const stringSchema = { type: "string" };
3
+ const booleanSchema = { type: "boolean" };
4
+ const numberSchema = { type: "number" };
5
+ const symbolSchema = {
6
+ type: "string",
7
+ description: "RapidX symbol, for example BINANCE_PERP_BTC_USDT or OKX_SWAP_BTC_USDT.",
8
+ examples: ["BINANCE_PERP_BTC_USDT", "OKX_SWAP_BTC_USDT"]
9
+ };
10
+ const sideSchema = {
11
+ type: "string",
12
+ enum: ["BUY", "SELL"],
13
+ description: "Order side. Use BUY to buy/open long or buy back short; use SELL to sell/reduce long or open short."
14
+ };
15
+ const orderTypeSchema = {
16
+ type: "string",
17
+ enum: ["LIMIT", "MARKET"],
18
+ description: "Order type. LIMIT is the expected default for agent-driven trading; MARKET may be blocked by safety policy."
19
+ };
20
+ const priceSchema = {
21
+ type: "string",
22
+ description: "Limit price as a decimal string in quote currency.",
23
+ unit: "quote currency",
24
+ examples: ["65000"]
25
+ };
26
+ const quantitySchema = {
27
+ type: "string",
28
+ description: "Base asset quantity as a decimal string. For contract venues, this is the RapidX order quantity accepted by the symbol.",
29
+ unit: "base asset or contract quantity",
30
+ examples: ["0.001"]
31
+ };
32
+ const amountSchema = {
33
+ type: "string",
34
+ description: "Quote amount as a decimal string when placing by quote notional instead of quantity.",
35
+ unit: "quote currency",
36
+ examples: ["10"]
37
+ };
38
+ const maxNotionalSchema = {
39
+ type: "string",
40
+ description: "Safety upper bound for this operation, expressed as a decimal string in quote currency. This is not the target order amount.",
41
+ unit: "quote currency",
42
+ examples: ["10"]
43
+ };
44
+ const clientOrderIdSchema = {
45
+ type: "string",
46
+ description: "Caller-generated idempotency key for the order request.",
47
+ examples: ["agent-test-20260529-001"]
48
+ };
49
+ const previewIdSchema = {
50
+ type: "string",
51
+ description: "Preview id returned by the matching preview tool or command.",
52
+ examples: ["rpv_00000000-0000-4000-8000-000000000000"]
53
+ };
54
+ const continueConsentIdSchema = {
55
+ type: "string",
56
+ description: "Submit confirmation id. Prefer using preview.confirmation.submitToken returned by the matching preview result.",
57
+ examples: ["confirm_rpv_00000000-0000-4000-8000-000000000000"]
58
+ };
59
+ const targetCapabilityIdSchema = {
60
+ type: "string",
61
+ description: "Target trade-write capabilityId to preview, for example order.cancel, position.set-leverage, or position.close.",
62
+ examples: ["order.cancel", "position.set-leverage", "position.close"]
63
+ };
64
+ const orderIdSchema = {
65
+ type: "string",
66
+ description: "RapidX order id returned by order.place, order.list, or order.get.",
67
+ examples: ["1234567890"]
68
+ };
69
+ const accountBalanceModeSchema = {
70
+ type: "string",
71
+ enum: ["portfolio", "account"],
72
+ description: "Balance source. portfolio uses /api/v1/trading/portfolio/assets; account uses /api/v1/account/balance."
73
+ };
74
+ const positionSideSchema = {
75
+ type: "string",
76
+ description: "Position side when the account is in hedge mode, for example LONG or SHORT. Omit in one-way NET mode unless RapidX returns a specific side."
77
+ };
78
+ const closePositionReduceOnlySchema = {
79
+ type: "boolean",
80
+ description: "Must be true for position.close. Do not pass side; RapidX determines BUY or SELL from the current position."
81
+ };
82
+ const algoConditionTypeSchema = { type: "string", enum: ["CONDITIONAL", "OCO", "ENTIRE_CLOSE_POSITION", "PARTIAL_CLOSE_POSITION"] };
83
+ const triggerTypeSchema = { type: "string", enum: ["LAST_PRICE", "MARK_PRICE"] };
84
+ export function inputSchemaForName(name) {
85
+ switch (name) {
86
+ case "EmptyInput":
87
+ return objectSchema({});
88
+ case "SymbolInput":
89
+ return objectSchema({ symbol: symbolSchema }, ["symbol"]);
90
+ case "OrderbookInput":
91
+ return objectSchema({ symbol: symbolSchema, depth: numberSchema }, ["symbol"]);
92
+ case "KlinesInput":
93
+ return objectSchema({ symbol: symbolSchema, interval: stringSchema, limit: numberSchema }, ["symbol"]);
94
+ case "AccountBalanceInput":
95
+ return objectSchema({ mode: accountBalanceModeSchema, currency: stringSchema });
96
+ case "OrderLookupInput":
97
+ return objectSchema({ orderId: orderIdSchema, clientOrderId: clientOrderIdSchema, symbol: symbolSchema });
98
+ case "OrderListInput":
99
+ case "OrderHistoryInput":
100
+ return objectSchema({ symbol: symbolSchema, pageSize: numberSchema, startTime: stringSchema, endTime: stringSchema });
101
+ case "PositionListInput":
102
+ case "AlgoListInput":
103
+ return objectSchema({ symbol: symbolSchema });
104
+ case "PositionHistoryInput":
105
+ return objectSchema({ symbol: symbolSchema, pageSize: numberSchema, startTime: stringSchema, endTime: stringSchema });
106
+ case "TradePreviewInput":
107
+ return objectSchema({
108
+ targetCapabilityId: targetCapabilityIdSchema,
109
+ symbol: symbolSchema,
110
+ side: sideSchema,
111
+ orderType: orderTypeSchema,
112
+ price: priceSchema,
113
+ quantity: quantitySchema,
114
+ amount: amountSchema,
115
+ timeInForce: stringSchema,
116
+ postOnly: booleanSchema,
117
+ reduceOnly: booleanSchema,
118
+ maxNotional: maxNotionalSchema,
119
+ clientOrderId: clientOrderIdSchema,
120
+ leverage: numberSchema,
121
+ mode: { type: "string", enum: ["BOTH", "NET"] },
122
+ exchange: stringSchema,
123
+ orderId: orderIdSchema,
124
+ algoOrderId: stringSchema,
125
+ triggerPrice: stringSchema,
126
+ triggerType: triggerTypeSchema,
127
+ conditionType: algoConditionTypeSchema,
128
+ stopLossPrice: stringSchema,
129
+ stopLossLimitPrice: stringSchema,
130
+ takeProfitPrice: stringSchema,
131
+ takeProfitLimitPrice: stringSchema,
132
+ algoType: stringSchema,
133
+ consentId: stringSchema,
134
+ ...compatibilityProperties()
135
+ }, ["targetCapabilityId"]);
136
+ case "PreviewOrderInput":
137
+ return {
138
+ ...objectSchema({
139
+ ...tradeCreateProperties(),
140
+ consentId: stringSchema,
141
+ ...compatibilityProperties()
142
+ }, ["symbol", "side", "orderType", "maxNotional", "clientOrderId"]),
143
+ oneOf: [{ required: ["quantity"] }, { required: ["amount"] }]
144
+ };
145
+ case "PlaceOrderInput":
146
+ return {
147
+ ...objectSchema({ ...tradeCreateProperties(), previewId: previewIdSchema, continueConsentId: continueConsentIdSchema }, [
148
+ "symbol",
149
+ "side",
150
+ "orderType",
151
+ "maxNotional",
152
+ "clientOrderId",
153
+ "previewId",
154
+ "continueConsentId"
155
+ ]),
156
+ oneOf: [{ required: ["quantity"] }, { required: ["amount"] }]
157
+ };
158
+ case "AmendOrderPreviewInput":
159
+ return {
160
+ ...objectSchema({ orderId: orderIdSchema, clientOrderId: clientOrderIdSchema, price: priceSchema, quantity: quantitySchema, ...compatibilityProperties() }),
161
+ allOf: [
162
+ { anyOf: [{ required: ["orderId"] }, { required: ["clientOrderId"] }] },
163
+ { anyOf: [{ required: ["price"] }, { required: ["quantity"] }] }
164
+ ]
165
+ };
166
+ case "CancelOrderPreviewInput":
167
+ return {
168
+ ...objectSchema({ orderId: orderIdSchema, clientOrderId: clientOrderIdSchema, ...compatibilityProperties() }),
169
+ anyOf: [{ required: ["orderId"] }, { required: ["clientOrderId"] }]
170
+ };
171
+ case "AmendOrderInput":
172
+ return {
173
+ ...objectSchema({ orderId: orderIdSchema, clientOrderId: clientOrderIdSchema, price: priceSchema, quantity: quantitySchema, previewId: previewIdSchema, continueConsentId: continueConsentIdSchema }, ["previewId", "continueConsentId"]),
174
+ allOf: [
175
+ { anyOf: [{ required: ["orderId"] }, { required: ["clientOrderId"] }] },
176
+ { anyOf: [{ required: ["price"] }, { required: ["quantity"] }] }
177
+ ]
178
+ };
179
+ case "CancelOrderInput":
180
+ return {
181
+ ...objectSchema({ orderId: orderIdSchema, clientOrderId: clientOrderIdSchema, previewId: previewIdSchema, continueConsentId: continueConsentIdSchema }, ["previewId", "continueConsentId"]),
182
+ anyOf: [{ required: ["orderId"] }, { required: ["clientOrderId"] }]
183
+ };
184
+ case "ClosePositionInput":
185
+ return objectSchema({ symbol: symbolSchema, positionSide: positionSideSchema, reduceOnly: closePositionReduceOnlySchema, maxNotional: maxNotionalSchema, previewId: previewIdSchema, continueConsentId: continueConsentIdSchema }, ["symbol", "reduceOnly", "maxNotional", "previewId", "continueConsentId"]);
186
+ case "SetLeverageInput":
187
+ return objectSchema({ symbol: symbolSchema, leverage: numberSchema, positionSide: stringSchema, previewId: previewIdSchema, continueConsentId: continueConsentIdSchema }, ["symbol", "leverage", "previewId", "continueConsentId"]);
188
+ case "SetPositionModeInput":
189
+ return objectSchema({ mode: { type: "string", enum: ["BOTH", "NET"] }, exchange: stringSchema, previewId: previewIdSchema, continueConsentId: continueConsentIdSchema }, ["mode", "exchange", "previewId", "continueConsentId"]);
190
+ case "AlgoPlaceInput":
191
+ return {
192
+ ...objectSchema({
193
+ ...tradeCreateProperties(),
194
+ algoType: stringSchema,
195
+ positionSide: stringSchema,
196
+ conditionType: algoConditionTypeSchema,
197
+ triggerPrice: stringSchema,
198
+ triggerType: triggerTypeSchema,
199
+ stopLossPrice: stringSchema,
200
+ stopLossLimitPrice: stringSchema,
201
+ takeProfitPrice: stringSchema,
202
+ takeProfitLimitPrice: stringSchema,
203
+ previewId: previewIdSchema,
204
+ continueConsentId: continueConsentIdSchema
205
+ }, [
206
+ "symbol",
207
+ "side",
208
+ "orderType",
209
+ "maxNotional",
210
+ "clientOrderId",
211
+ "algoType",
212
+ "previewId",
213
+ "continueConsentId"
214
+ ]),
215
+ oneOf: [{ required: ["quantity"] }, { required: ["amount"] }]
216
+ };
217
+ case "AlgoAmendInput":
218
+ return objectSchema({
219
+ algoOrderId: stringSchema,
220
+ clientOrderId: clientOrderIdSchema,
221
+ triggerPrice: stringSchema,
222
+ triggerType: triggerTypeSchema,
223
+ stopLossPrice: stringSchema,
224
+ stopLossLimitPrice: stringSchema,
225
+ takeProfitPrice: stringSchema,
226
+ takeProfitLimitPrice: stringSchema,
227
+ previewId: previewIdSchema,
228
+ continueConsentId: continueConsentIdSchema
229
+ }, ["previewId", "continueConsentId"]);
230
+ case "AlgoCancelInput":
231
+ return objectSchema({ algoOrderId: stringSchema, clientOrderId: clientOrderIdSchema, previewId: previewIdSchema, continueConsentId: continueConsentIdSchema }, ["previewId", "continueConsentId"]);
232
+ case "TradingVerificationInput":
233
+ return objectSchema({ symbol: symbolSchema, side: sideSchema, maxNotional: maxNotionalSchema, clientOrderId: clientOrderIdSchema, explicitUserConsent: booleanSchema, acceptedRiskText: stringSchema }, ["symbol", "side", "maxNotional", "clientOrderId"]);
234
+ case "ConfigGetInput":
235
+ case "ConfigUnsetInput":
236
+ return objectSchema({ key: stringSchema }, ["key"]);
237
+ case "ConfigSetInput":
238
+ return objectSchema({ key: stringSchema, value: stringSchema }, ["key", "value"]);
239
+ case "AuthInput":
240
+ return objectSchema({ source: stringSchema, credentialSource: stringSchema, accessKey: stringSchema, secretKey: stringSchema });
241
+ case "DoctorInput":
242
+ return objectSchema({ commandLine: stringSchema, preflightError: stringSchema });
243
+ case "InvocationCheckInput":
244
+ return objectSchema({ commandLine: stringSchema, preflightError: stringSchema });
245
+ case "UpdateCheckInput":
246
+ return objectSchema({ force: booleanSchema, manifestUrl: stringSchema, maxCacheAgeSeconds: numberSchema });
247
+ case "SchemaQuery":
248
+ return objectSchema({ consumer: stringSchema, consumerVersion: stringSchema, includeExamples: booleanSchema });
249
+ case "SelfCheckInput":
250
+ return objectSchema({ scope: stringSchema, readOnly: booleanSchema, checkUpdates: booleanSchema });
251
+ default:
252
+ return objectSchema({});
253
+ }
254
+ }
255
+ export function assertInputMatchesSchema(schemaName, input, options = {}) {
256
+ const schema = inputSchemaForName(schemaName);
257
+ const allowedFields = new Set(Object.keys(schema.properties));
258
+ for (const field of options.allowedExtraFields ?? []) {
259
+ allowedFields.add(field);
260
+ }
261
+ const ignoredRequiredFields = new Set(options.ignoredRequiredFields ?? []);
262
+ const problems = [];
263
+ for (const [key, value] of Object.entries(input)) {
264
+ const fieldSchema = schema.properties[key];
265
+ if (!fieldSchema) {
266
+ if (!schema.additionalProperties && !allowedFields.has(key)) {
267
+ if (schemaName === "ClosePositionInput" && key === "side") {
268
+ problems.push("position.close does not accept side; close side is determined by the current position");
269
+ }
270
+ else if (schemaName === "ClosePositionInput" && key === "quantity") {
271
+ problems.push("position.close does not accept quantity; RapidX close-position closes the target symbol/positionSide. Use a reduce-only order for partial close");
272
+ }
273
+ else {
274
+ problems.push(`unknown field: ${key}`);
275
+ }
276
+ }
277
+ continue;
278
+ }
279
+ if (!matchesType(value, fieldSchema)) {
280
+ problems.push(`invalid type for ${key}`);
281
+ }
282
+ if (fieldSchema.enum && typeof value === "string" && !fieldSchema.enum.includes(value)) {
283
+ problems.push(`invalid value for ${key}`);
284
+ }
285
+ }
286
+ for (const field of schema.required ?? []) {
287
+ if (ignoredRequiredFields.has(field)) {
288
+ continue;
289
+ }
290
+ if (!hasValue(input[field])) {
291
+ problems.push(`missing required field: ${field}`);
292
+ }
293
+ }
294
+ if (schema.oneOf && !schema.oneOf.some((candidate) => (candidate.required ?? []).every((field) => hasValue(input[field])))) {
295
+ const labels = schema.oneOf.map((candidate) => (candidate.required ?? []).join(", ")).join(" or ");
296
+ problems.push(`missing one of: ${labels}`);
297
+ }
298
+ if (schema.anyOf) {
299
+ collectAnyOfProblem(schema.anyOf, input, problems);
300
+ }
301
+ for (const group of schema.allOf ?? []) {
302
+ if (group.required) {
303
+ for (const field of group.required) {
304
+ if (!hasValue(input[field])) {
305
+ problems.push(`missing required field: ${field}`);
306
+ }
307
+ }
308
+ }
309
+ if (group.anyOf) {
310
+ collectAnyOfProblem(group.anyOf, input, problems);
311
+ }
312
+ }
313
+ if (problems.length > 0) {
314
+ throw new ProductError({
315
+ code: "RCORE00001",
316
+ status: "FAIL",
317
+ message: `Input schema validation failed: ${problems.join("; ")}.`
318
+ });
319
+ }
320
+ void allowedFields;
321
+ }
322
+ function collectAnyOfProblem(rules, input, problems) {
323
+ if (!rules.some((candidate) => (candidate.required ?? []).every((field) => hasValue(input[field])))) {
324
+ const labels = rules.map((candidate) => (candidate.required ?? []).join(", ")).join(" or ");
325
+ problems.push(`missing any of: ${labels}`);
326
+ }
327
+ }
328
+ function objectSchema(properties, required) {
329
+ return {
330
+ type: "object",
331
+ additionalProperties: false,
332
+ properties,
333
+ ...(required ? { required } : {})
334
+ };
335
+ }
336
+ function tradeCreateProperties() {
337
+ return {
338
+ symbol: symbolSchema,
339
+ side: sideSchema,
340
+ orderType: orderTypeSchema,
341
+ price: priceSchema,
342
+ quantity: quantitySchema,
343
+ amount: amountSchema,
344
+ notional: stringSchema,
345
+ timeInForce: stringSchema,
346
+ postOnly: booleanSchema,
347
+ reduceOnly: booleanSchema,
348
+ maxNotional: maxNotionalSchema,
349
+ clientOrderId: clientOrderIdSchema
350
+ };
351
+ }
352
+ function compatibilityProperties() {
353
+ return {
354
+ mcpSchemaVersion: stringSchema,
355
+ skillsVersion: stringSchema,
356
+ skillsSchemaVersion: stringSchema
357
+ };
358
+ }
359
+ function matchesType(value, schema) {
360
+ if (value === undefined || value === null) {
361
+ return true;
362
+ }
363
+ if (!schema.type) {
364
+ return true;
365
+ }
366
+ return typeof value === schema.type;
367
+ }
368
+ function hasValue(value) {
369
+ return value !== undefined && value !== null && value !== "";
370
+ }
@@ -0,0 +1 @@
1
+ export const SCHEMA_VERSION = "2026-05-23";
@@ -0,0 +1,74 @@
1
+ export class ProductError extends Error {
2
+ code;
3
+ status;
4
+ details;
5
+ constructor(options) {
6
+ super(options.message);
7
+ this.name = "ProductError";
8
+ this.code = options.code;
9
+ this.status = options.status;
10
+ if (options.details) {
11
+ this.details = options.details;
12
+ }
13
+ }
14
+ toEnvelope(evidence = []) {
15
+ return {
16
+ ok: false,
17
+ status: this.status,
18
+ code: this.code,
19
+ message: this.message,
20
+ evidence
21
+ };
22
+ }
23
+ }
24
+ export const CORE_ERRORS = {
25
+ MISSING_CREDENTIAL: "RCORE01001",
26
+ INVALID_CREDENTIAL: "RCORE01002",
27
+ MISSING_API_HOST: "RCORE01003",
28
+ SECRET_REDACTION_RISK: "RCORE90002",
29
+ UPSTREAM_REJECTED: "RCORE22001",
30
+ UPSTREAM_TIMEOUT: "RCORE23002",
31
+ UPSTREAM_RATE_LIMITED: "RCORE23003",
32
+ SCHEMA_INVALID: "RCORE30001"
33
+ };
34
+ export function normalizeUnknownError(error, fallbackCode = "RCORE00001") {
35
+ if (error instanceof ProductError) {
36
+ return error;
37
+ }
38
+ if (isUpstreamNetworkError(error)) {
39
+ return new ProductError({
40
+ code: CORE_ERRORS.UPSTREAM_TIMEOUT,
41
+ status: "FAIL",
42
+ message: "Upstream request failed before receiving a response."
43
+ });
44
+ }
45
+ const message = error instanceof Error ? error.message : String(error);
46
+ return new ProductError({
47
+ code: fallbackCode,
48
+ status: "FAIL",
49
+ message
50
+ });
51
+ }
52
+ function isUpstreamNetworkError(error) {
53
+ if (!(error instanceof Error)) {
54
+ return false;
55
+ }
56
+ if (error.name === "AbortError" || error.name === "TimeoutError") {
57
+ return true;
58
+ }
59
+ if (error.message === "fetch failed" || error.message.includes("network")) {
60
+ return true;
61
+ }
62
+ const cause = error.cause;
63
+ if (!cause || typeof cause !== "object") {
64
+ return false;
65
+ }
66
+ const code = cause.code;
67
+ return typeof code === "string" && [
68
+ "ECONNRESET",
69
+ "ECONNREFUSED",
70
+ "ENOTFOUND",
71
+ "ETIMEDOUT",
72
+ "EAI_AGAIN"
73
+ ].includes(code);
74
+ }
@@ -0,0 +1,24 @@
1
+ export * from "./contracts/types.js";
2
+ export * from "./contracts/capabilities.js";
3
+ export * from "./contracts/events.js";
4
+ export * from "./contracts/input-schema.js";
5
+ export * from "./contracts/evidence.js";
6
+ export * from "./contracts/compatibility.js";
7
+ export * from "./config/credential.js";
8
+ export * from "./config/resolve.js";
9
+ export * from "./audit/redaction.js";
10
+ export * from "./audit/writer.js";
11
+ export * from "./errors/product-error.js";
12
+ export * from "./client/signing.js";
13
+ export * from "./client/rapid-x-client.js";
14
+ export * from "./client/capability-executor.js";
15
+ export * from "./client/symbol.js";
16
+ export * from "./safety/policy.js";
17
+ export * from "./safety/raw-api.js";
18
+ export * from "./trading/preview.js";
19
+ export * from "./update/check-update.js";
20
+ export * from "./self-check/run-self-check.js";
21
+ export * from "./self-check/live-read-only-probes.js";
22
+ export * from "./self-check/live-trading-verification-probes.js";
23
+ export * from "./trading/trading-verification.js";
24
+ export * from "./version.js";