@trucore/atf 1.3.0 → 1.4.0

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 CHANGED
@@ -5,7 +5,7 @@
5
5
  ## One-Liner
6
6
 
7
7
  ```bash
8
- npx @trucore/atf@1.3.0 simulate --preset swap_small --verify --pretty
8
+ npx @trucore/atf@1.3.1 simulate --preset swap_small --verify --pretty
9
9
  ```
10
10
 
11
11
  That's it. No install, no config, no API key required.
@@ -22,31 +22,37 @@ That's it. No install, no config, no API key required.
22
22
  ## Install (optional)
23
23
 
24
24
  ```bash
25
- npm install -g @trucore/atf@1.3.0
25
+ npm install -g @trucore/atf@1.3.1
26
26
  ```
27
27
 
28
28
  Or use directly with `npx` (always pin the version):
29
29
 
30
30
  ```bash
31
- npx @trucore/atf@1.3.0 simulate --preset swap_small
31
+ npx @trucore/atf@1.3.1 simulate --preset swap_small
32
+ ```
33
+
34
+ ## Quickstart: Doctor (Dev Environment Check)
35
+
36
+ ```bash
37
+ npx @trucore/atf@1.3.1 doctor --pretty
32
38
  ```
33
39
 
34
40
  ## Quickstart: Devnet Burner
35
41
 
36
42
  ```bash
37
- npx @trucore/atf@1.3.0 swap --burner --devnet --in SOL --out USDC --amount-in 0.01 --execute --yes --confirm
43
+ npx @trucore/atf@1.3.1 swap --burner --devnet --in SOL --out USDC --amount-in 0.01 --execute --yes --confirm
38
44
  ```
39
45
 
40
46
  ## Quickstart: Helius Profile Setup
41
47
 
42
48
  ```bash
43
- npx @trucore/atf@1.3.0 config init --yes
44
- npx @trucore/atf@1.3.0 profile create devnet
45
- npx @trucore/atf@1.3.0 profile use devnet
46
- npx @trucore/atf@1.3.0 config set solana_cluster devnet
47
- npx @trucore/atf@1.3.0 config set rpc_url helius
49
+ npx @trucore/atf@1.3.1 config init --yes
50
+ npx @trucore/atf@1.3.1 profile create devnet
51
+ npx @trucore/atf@1.3.1 profile use devnet
52
+ npx @trucore/atf@1.3.1 config set solana_cluster devnet
53
+ npx @trucore/atf@1.3.1 config set rpc_url helius
48
54
  export HELIUS_API_KEY=your_key_here
49
- npx @trucore/atf@1.3.0 rpc ping
55
+ npx @trucore/atf@1.3.1 rpc ping
50
56
  ```
51
57
 
52
58
  ## Commands
@@ -56,9 +62,9 @@ npx @trucore/atf@1.3.0 rpc ping
56
62
  Check API health and round-trip latency.
57
63
 
58
64
  ```bash
59
- npx @trucore/atf@1.3.0 health
60
- npx @trucore/atf@1.3.0 health --pretty
61
- npx @trucore/atf@1.3.0 health --base-url http://localhost:3000
65
+ npx @trucore/atf@1.3.1 health
66
+ npx @trucore/atf@1.3.1 health --pretty
67
+ npx @trucore/atf@1.3.1 health --base-url http://localhost:3000
62
68
  ```
63
69
 
64
70
  **Output shape:**
@@ -72,9 +78,9 @@ npx @trucore/atf@1.3.0 health --base-url http://localhost:3000
72
78
  Run a transaction simulation against the ATF API.
73
79
 
74
80
  ```bash
75
- npx @trucore/atf@1.3.0 simulate --preset swap_small --verify
76
- npx @trucore/atf@1.3.0 simulate --preset swap_too_large --pretty
77
- npx @trucore/atf@1.3.0 simulate --json '{"chain_id":1,"value_eth":"0.5"}' --base-url http://localhost:3000
81
+ npx @trucore/atf@1.3.1 simulate --preset swap_small --verify
82
+ npx @trucore/atf@1.3.1 simulate --preset swap_too_large --pretty
83
+ npx @trucore/atf@1.3.1 simulate --json '{"chain_id":1,"value_eth":"0.5"}' --base-url http://localhost:3000
78
84
  ```
79
85
 
80
86
  **Output shape:**
@@ -88,8 +94,8 @@ npx @trucore/atf@1.3.0 simulate --json '{"chain_id":1,"value_eth":"0.5"}' --base
88
94
  Approve a pending intent (requires authentication).
89
95
 
90
96
  ```bash
91
- npx @trucore/atf@1.3.0 approve --intent abc123 --token mytoken
92
- npx @trucore/atf@1.3.0 approve --intent abc123 --token mytoken --pretty
97
+ npx @trucore/atf@1.3.1 approve --intent abc123 --token mytoken
98
+ npx @trucore/atf@1.3.1 approve --intent abc123 --token mytoken --pretty
93
99
  ```
94
100
 
95
101
  **Output shape:**
@@ -103,14 +109,14 @@ npx @trucore/atf@1.3.0 approve --intent abc123 --token mytoken --pretty
103
109
  Show rich version information (CLI version, Node version, build info).
104
110
 
105
111
  ```bash
106
- npx @trucore/atf@1.3.0 version
107
- npx @trucore/atf@1.3.0 version --pretty
112
+ npx @trucore/atf@1.3.1 version
113
+ npx @trucore/atf@1.3.1 version --pretty
108
114
  ```
109
115
 
110
116
  **Output shape:**
111
117
 
112
118
  ```json
113
- { "ok": true, "cli_version": "1.3.0", "node_version": "v22.0.0", "platform": "linux", "arch": "x64", "default_base_url": "https://api.trucore.xyz", "build_commit": "abc1234", "build_date": "2025-01-01T00:00:00Z" }
119
+ { "ok": true, "cli_version": "1.3.1", "node_version": "v22.0.0", "platform": "linux", "arch": "x64", "default_base_url": "https://api.trucore.xyz", "build_commit": "abc1234", "build_date": "2025-01-01T00:00:00Z" }
114
120
  ```
115
121
 
116
122
  ### `swap`
@@ -123,7 +129,7 @@ Execute a **real on-chain Solana swap** (Jupiter DEX) gated by ATF policy evalua
123
129
  **Dry run (no funds move):**
124
130
 
125
131
  ```bash
126
- npx @trucore/atf@1.3.0 swap \
132
+ npx @trucore/atf@1.3.1 swap \
127
133
  --in SOL --out USDC \
128
134
  --amount-in 0.001 \
129
135
  --slippage-bps 50 \
@@ -134,7 +140,7 @@ npx @trucore/atf@1.3.0 swap \
134
140
  **Real transaction (mainnet):**
135
141
 
136
142
  ```bash
137
- npx @trucore/atf@1.3.0 swap \
143
+ npx @trucore/atf@1.3.1 swap \
138
144
  --in SOL --out USDC \
139
145
  --amount-in 0.001 \
140
146
  --slippage-bps 50 \
@@ -146,7 +152,7 @@ npx @trucore/atf@1.3.0 swap \
146
152
  **Devnet burner one-liner (generates ephemeral keypair, no files needed):**
147
153
 
148
154
  ```bash
149
- npx @trucore/atf@1.3.0 swap \
155
+ npx @trucore/atf@1.3.1 swap \
150
156
  --burner --devnet \
151
157
  --in SOL --out USDC \
152
158
  --amount-in 0.01 \
@@ -316,7 +322,7 @@ atf whoami --profile staging
316
322
  **Output shape:**
317
323
 
318
324
  ```json
319
- { "ok": true, "profile": "default", "atf_base_url": "https://api.trucore.xyz", "solana_cluster": "mainnet-beta", "rpc_host": "mainnet.helius-rpc.com", "commitment": "confirmed", "explorer": "solscan", "cli_version": "1.3.0" }
325
+ { "ok": true, "profile": "default", "atf_base_url": "https://api.trucore.xyz", "solana_cluster": "mainnet-beta", "rpc_host": "mainnet.helius-rpc.com", "commitment": "confirmed", "explorer": "solscan", "cli_version": "1.3.1" }
320
326
  ```
321
327
 
322
328
  ### `ls`
@@ -339,6 +345,43 @@ atf completion fish > ~/.config/fish/completions/atf.fish
339
345
  atf completion powershell >> $PROFILE
340
346
  ```
341
347
 
348
+ ### `doctor`
349
+
350
+ Run a comprehensive dev environment health check — ATF API, RPC, config, keypair, and explorer.
351
+
352
+ ```bash
353
+ npx @trucore/atf@1.3.1 doctor --pretty
354
+ npx @trucore/atf@1.3.1 doctor --profile devnet --pretty
355
+ npx @trucore/atf@1.3.1 doctor --rpc https://custom-rpc.example.com
356
+ npx @trucore/atf@1.3.1 doctor --verbose
357
+ ```
358
+
359
+ **Output shape (JSON, default):**
360
+
361
+ ```json
362
+ {
363
+ "ok": true,
364
+ "summary": { "status": "ok", "passed": 5, "warned": 0, "failed": 0 },
365
+ "env": { "cli_version": "1.3.1", "node_version": "v22.0.0", "platform": "linux", "arch": "x64" },
366
+ "effective": { "profile": "default", "atf_base_url": "https://api.trucore.xyz", "solana_cluster": "mainnet" },
367
+ "checks": [
368
+ { "name": "atf_health", "status": "pass", "latency_ms": 42, "details": { "http_status": 200 }, "actions": [] },
369
+ { "name": "simulate_sanity", "status": "pass", "latency_ms": 55, "details": { "decision": "allowed" }, "actions": [] },
370
+ { "name": "rpc_health", "status": "pass", "latency_ms": 30, "details": { "solana_version": "2.2.1" }, "actions": [] },
371
+ { "name": "keypair", "status": "pass", "details": { "configured": true, "valid": true }, "actions": [] },
372
+ { "name": "explorer_link", "status": "pass", "details": { "explorer": "solscan" }, "actions": [] }
373
+ ]
374
+ }
375
+ ```
376
+
377
+ **Exit codes:**
378
+
379
+ | Code | Meaning |
380
+ |------|---------|
381
+ | 0 | All checks pass (or warn-only) |
382
+ | 1 | User/actionable misconfiguration (missing Helius key, invalid config) |
383
+ | 2 | Network/server failure (ATF API or RPC unreachable) |
384
+
342
385
  ## Global Options
343
386
 
344
387
  | Flag | Description | Default |
@@ -525,9 +568,10 @@ npm pack --dry-run
525
568
  npm publish --access public
526
569
 
527
570
  # 5. Verify install (from a clean machine or CI)
528
- npx @trucore/atf@1.3.0 version
529
- npx @trucore/atf@1.3.0 health
530
- npx @trucore/atf@1.3.0 whoami
571
+ npx @trucore/atf@1.3.1 version
572
+ npx @trucore/atf@1.3.1 health
573
+ npx @trucore/atf@1.3.1 whoami
574
+ npx @trucore/atf@1.3.1 doctor --pretty
531
575
  ```
532
576
 
533
577
  ## License