perp-cli 0.12.14 → 0.12.15

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/dist/index.js CHANGED
@@ -705,7 +705,21 @@ else {
705
705
  const msg = err instanceof Error ? err.message : String(err);
706
706
  if (isJson()) {
707
707
  const { jsonError } = await import("./utils.js");
708
- console.log(JSON.stringify(jsonError("FATAL", msg)));
708
+ const { PerpError } = await import("./errors.js");
709
+ // Preserve typed PerpError code + remediation through the top-level
710
+ // catch (Rule #2: stay loud, keep semantic envelope).
711
+ if (err instanceof PerpError) {
712
+ const s = err.structured;
713
+ console.log(JSON.stringify(jsonError(s.code, s.message, {
714
+ status: s.status,
715
+ retryable: s.retryable,
716
+ retryAfterMs: s.retryAfterMs,
717
+ remediation: s.remediation,
718
+ })));
719
+ }
720
+ else {
721
+ console.log(JSON.stringify(jsonError("FATAL", msg)));
722
+ }
709
723
  }
710
724
  else {
711
725
  console.error(chalk.red(msg));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "perp-cli",
3
- "version": "0.12.14",
3
+ "version": "0.12.15",
4
4
  "description": "Multi-DEX Perpetual Futures CLI - Pacifica, Hyperliquid, Lighter, Aster",
5
5
  "bin": {
6
6
  "perp": "dist/index.js",
@@ -5,7 +5,7 @@ allowed-tools: "Bash(perp:*), Bash(npx perp-cli:*), Bash(npx -y perp-cli:*)"
5
5
  license: MIT
6
6
  metadata:
7
7
  author: hypurrquant
8
- version: "0.12.14"
8
+ version: "0.12.15"
9
9
  ---
10
10
 
11
11
  # perp-cli Agent Guide
@@ -41,7 +41,7 @@ Multi-DEX perpetual futures CLI + MCP server — Pacifica (Solana), Hyperliquid
41
41
  ## Install
42
42
 
43
43
  ```bash
44
- perp --version 2>/dev/null # check if exists (must be >= 0.12.14)
44
+ perp --version 2>/dev/null # check if exists (must be >= 0.12.15)
45
45
  npm install -g perp-cli@latest 2>/dev/null || npx -y perp-cli@latest --json --version
46
46
  ```
47
47