xno-skills 4.7.5 → 5.0.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 +62 -37
- package/bin/xno-mcp +1 -1
- package/dist/cjs/banner.js.map +1 -1
- package/dist/cjs/base32.d.ts.map +1 -1
- package/dist/cjs/base32.js +1 -2
- package/dist/cjs/base32.js.map +1 -1
- package/dist/cjs/cli.js +77 -134
- package/dist/cjs/cli.js.map +1 -1
- package/dist/cjs/config.d.ts.map +1 -1
- package/dist/cjs/config.js +1 -5
- package/dist/cjs/config.js.map +1 -1
- package/dist/cjs/convert.d.ts +10 -10
- package/dist/cjs/convert.d.ts.map +1 -1
- package/dist/cjs/convert.js +105 -22
- package/dist/cjs/convert.js.map +1 -1
- package/dist/cjs/index.d.ts +3 -3
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/mcp.d.ts.map +1 -1
- package/dist/cjs/mcp.js +218 -168
- package/dist/cjs/mcp.js.map +1 -1
- package/dist/cjs/meta.d.ts.map +1 -1
- package/dist/cjs/meta.js +4 -4
- package/dist/cjs/meta.js.map +1 -1
- package/dist/cjs/nano-actions.d.ts +5 -2
- package/dist/cjs/nano-actions.d.ts.map +1 -1
- package/dist/cjs/nano-actions.js +73 -22
- package/dist/cjs/nano-actions.js.map +1 -1
- package/dist/cjs/nano-address.d.ts.map +1 -1
- package/dist/cjs/nano-address.js +5 -3
- package/dist/cjs/nano-address.js.map +1 -1
- package/dist/cjs/nano-runtime.d.ts +14 -0
- package/dist/cjs/nano-runtime.d.ts.map +1 -0
- package/dist/cjs/nano-runtime.js +105 -0
- package/dist/cjs/nano-runtime.js.map +1 -0
- package/dist/cjs/ows.d.ts.map +1 -1
- package/dist/cjs/ows.js +4 -2
- package/dist/cjs/ows.js.map +1 -1
- package/dist/cjs/payment-state.d.ts +23 -0
- package/dist/cjs/payment-state.d.ts.map +1 -0
- package/dist/cjs/payment-state.js +88 -0
- package/dist/cjs/payment-state.js.map +1 -0
- package/dist/cjs/pow.d.ts +3 -6
- package/dist/cjs/pow.d.ts.map +1 -1
- package/dist/cjs/pow.js +3 -7
- package/dist/cjs/pow.js.map +1 -1
- package/dist/cjs/qr.d.ts.map +1 -1
- package/dist/cjs/qr.js +12 -3
- package/dist/cjs/qr.js.map +1 -1
- package/dist/cjs/rpc.d.ts.map +1 -1
- package/dist/cjs/rpc.js +20 -7
- package/dist/cjs/rpc.js.map +1 -1
- package/dist/cjs/state-block.d.ts.map +1 -1
- package/dist/cjs/state-block.js.map +1 -1
- package/dist/cjs/state-store.d.ts +17 -5
- package/dist/cjs/state-store.d.ts.map +1 -1
- package/dist/cjs/state-store.js +165 -27
- package/dist/cjs/state-store.js.map +1 -1
- package/dist/cjs/validate.d.ts.map +1 -1
- package/dist/cjs/validate.js +0 -4
- package/dist/cjs/validate.js.map +1 -1
- package/dist/cjs/version.d.ts +2 -2
- package/dist/cjs/version.js +1 -1
- package/dist/esm/banner.js.map +1 -1
- package/dist/esm/base32.d.ts.map +1 -1
- package/dist/esm/base32.js +1 -2
- package/dist/esm/base32.js.map +1 -1
- package/dist/esm/cli.js +77 -134
- package/dist/esm/cli.js.map +1 -1
- package/dist/esm/config.d.ts.map +1 -1
- package/dist/esm/config.js +1 -5
- package/dist/esm/config.js.map +1 -1
- package/dist/esm/convert.d.ts +10 -10
- package/dist/esm/convert.d.ts.map +1 -1
- package/dist/esm/convert.js +105 -22
- package/dist/esm/convert.js.map +1 -1
- package/dist/esm/index.d.ts +3 -3
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/mcp.d.ts.map +1 -1
- package/dist/esm/mcp.js +218 -168
- package/dist/esm/mcp.js.map +1 -1
- package/dist/esm/meta.d.ts.map +1 -1
- package/dist/esm/meta.js +4 -4
- package/dist/esm/meta.js.map +1 -1
- package/dist/esm/nano-actions.d.ts +5 -2
- package/dist/esm/nano-actions.d.ts.map +1 -1
- package/dist/esm/nano-actions.js +73 -22
- package/dist/esm/nano-actions.js.map +1 -1
- package/dist/esm/nano-address.d.ts.map +1 -1
- package/dist/esm/nano-address.js +5 -3
- package/dist/esm/nano-address.js.map +1 -1
- package/dist/esm/nano-runtime.d.ts +14 -0
- package/dist/esm/nano-runtime.d.ts.map +1 -0
- package/dist/esm/nano-runtime.js +105 -0
- package/dist/esm/nano-runtime.js.map +1 -0
- package/dist/esm/ows.d.ts.map +1 -1
- package/dist/esm/ows.js +4 -2
- package/dist/esm/ows.js.map +1 -1
- package/dist/esm/payment-state.d.ts +23 -0
- package/dist/esm/payment-state.d.ts.map +1 -0
- package/dist/esm/payment-state.js +88 -0
- package/dist/esm/payment-state.js.map +1 -0
- package/dist/esm/pow.d.ts +3 -6
- package/dist/esm/pow.d.ts.map +1 -1
- package/dist/esm/pow.js +3 -7
- package/dist/esm/pow.js.map +1 -1
- package/dist/esm/qr.d.ts.map +1 -1
- package/dist/esm/qr.js +12 -3
- package/dist/esm/qr.js.map +1 -1
- package/dist/esm/rpc.d.ts.map +1 -1
- package/dist/esm/rpc.js +20 -7
- package/dist/esm/rpc.js.map +1 -1
- package/dist/esm/state-block.d.ts.map +1 -1
- package/dist/esm/state-block.js.map +1 -1
- package/dist/esm/state-store.d.ts +17 -5
- package/dist/esm/state-store.d.ts.map +1 -1
- package/dist/esm/state-store.js +165 -27
- package/dist/esm/state-store.js.map +1 -1
- package/dist/esm/validate.d.ts.map +1 -1
- package/dist/esm/validate.js +0 -4
- package/dist/esm/validate.js.map +1 -1
- package/dist/esm/version.d.ts +2 -2
- package/dist/esm/version.js +1 -1
- package/package.json +20 -4
- package/skills/nano/SKILL.md +94 -60
- package/skills/nano/references/blocklattice.md +6 -3
- package/skills/nano/references/config.md +4 -0
- package/skills/nano/references/mcp.md +4 -4
- package/skills/nano/references/payment.create.md +10 -7
- package/skills/nano/references/payment.receive.md +2 -0
- package/skills/nano/references/payment.refund.md +1 -0
- package/skills/nano/references/troubleshooting.md +13 -13
- package/skills/nano/references/validate.md +2 -2
- package/dist/cjs/work-threshold.d.ts +0 -2
- package/dist/cjs/work-threshold.d.ts.map +0 -1
- package/dist/cjs/work-threshold.js +0 -25
- package/dist/cjs/work-threshold.js.map +0 -1
- package/dist/esm/work-threshold.d.ts +0 -2
- package/dist/esm/work-threshold.d.ts.map +0 -1
- package/dist/esm/work-threshold.js +0 -25
- package/dist/esm/work-threshold.js.map +0 -1
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ Built-in skill for Personal AI Agents (OpenClaw etc.) and humans with AI Coding
|
|
|
39
39
|
|
|
40
40
|
```bash
|
|
41
41
|
npx skills add CasualSecurityInc/xno-skills -g
|
|
42
|
-
# or non-interactively, i.e. for agent use:
|
|
42
|
+
# or non-interactively, i.e. for agent use:
|
|
43
43
|
npx -y skills add CasualSecurityInc/xno-skills -g -y --all
|
|
44
44
|
```
|
|
45
45
|
|
|
@@ -52,12 +52,15 @@ npx -y skills add CasualSecurityInc/xno-skills -g -y --all
|
|
|
52
52
|
|
|
53
53
|
> [!IMPORTANT]
|
|
54
54
|
> If you installed skills from this repository before May 4, 2026, you have 11 individual `nano-*` skills that have been consolidated into a single `nano` skill. Remove the old ones first:
|
|
55
|
+
>
|
|
55
56
|
> ```bash
|
|
56
57
|
> npx skills remove nano-block-lattice-expert nano-check-balance nano-convert-units nano-create-wallet nano-generate-qr nano-mcp-wallet nano-request-payment nano-return-funds nano-sign-message nano-validate-address nano-verify-message -g -y
|
|
57
58
|
> ```
|
|
59
|
+
>
|
|
58
60
|
> Then reinstall as above.
|
|
59
61
|
|
|
60
62
|
Available skills:
|
|
63
|
+
|
|
61
64
|
- `nano`: Wallet ops, balance, send/receive, QR codes, address validation, unit conversion, payment requests, refunds, block-lattice protocol expertise, and more — all in one skill. Uses `xno-mcp` MCP tools first, falls back to `xno-skills` CLI.
|
|
62
65
|
|
|
63
66
|
## CLI
|
|
@@ -65,59 +68,60 @@ Available skills:
|
|
|
65
68
|
### Installation & Upgrades
|
|
66
69
|
|
|
67
70
|
To install or upgrade the CLI, AI agent skills, and wallet dependencies to the latest version, run:
|
|
71
|
+
|
|
68
72
|
```bash
|
|
69
73
|
npm install -g xno-skills && npx -y skills add CasualSecurityInc/xno-skills -g -y --all
|
|
70
74
|
xno-skills --help
|
|
71
75
|
```
|
|
72
76
|
|
|
73
77
|
To pin to the current stable release instead:
|
|
78
|
+
|
|
74
79
|
```bash
|
|
75
|
-
npm install -g xno-skills@
|
|
80
|
+
npm install -g xno-skills@5.0.0 && npx -y skills add CasualSecurityInc/xno-skills -g -y --all
|
|
76
81
|
```
|
|
77
82
|
|
|
78
|
-
|
|
79
83
|
### Wallet Operations
|
|
80
84
|
|
|
81
|
-
| Command
|
|
82
|
-
|
|
83
|
-
| `wallets [options]`
|
|
84
|
-
| `balance [options]`
|
|
85
|
-
| `receive [options]`
|
|
86
|
-
| `send [options]`
|
|
87
|
-
| `change-rep [options]`
|
|
85
|
+
| Command | Description |
|
|
86
|
+
| ------------------------ | ------------------------------------ |
|
|
87
|
+
| `wallets [options]` | List wallets that have Nano accounts |
|
|
88
|
+
| `balance [options]` | Show balance and pending amount |
|
|
89
|
+
| `receive [options]` | Receive pending blocks |
|
|
90
|
+
| `send [options]` | Send Nano |
|
|
91
|
+
| `change-rep [options]` | Submit a change representative block |
|
|
88
92
|
| `submit-block [options]` | Sign and submit a prepared block hex |
|
|
89
|
-
| `history [options]`
|
|
93
|
+
| `history [options]` | Show transaction history |
|
|
90
94
|
|
|
91
95
|
### Utilities
|
|
92
96
|
|
|
93
|
-
| Command
|
|
94
|
-
|
|
95
|
-
| `info [options]`
|
|
96
|
-
| `convert [options] <amount> <from>` | Convert between XNO units
|
|
97
|
-
| `qr [options] <address>`
|
|
98
|
-
| `validate [options] <input>`
|
|
97
|
+
| Command | Description |
|
|
98
|
+
| ----------------------------------- | ----------------------------------------------------------------- |
|
|
99
|
+
| `info [options]` | Discover the current state and representative of any Nano account |
|
|
100
|
+
| `convert [options] <amount> <from>` | Convert between XNO units |
|
|
101
|
+
| `qr [options] <address>` | Generate a QR code for a Nano address |
|
|
102
|
+
| `validate [options] <input>` | Validate a Nano address or block hash |
|
|
99
103
|
|
|
100
104
|
### Cryptography & Signing
|
|
101
105
|
|
|
102
|
-
| Command
|
|
103
|
-
|
|
104
|
-
| `sign [options] <message>`
|
|
105
|
-
| `verify [options] <address> <message> <signature>` | Verify a NOMS message signature
|
|
106
|
+
| Command | Description |
|
|
107
|
+
| -------------------------------------------------- | -------------------------------------- |
|
|
108
|
+
| `sign [options] <message>` | Sign a NOMS message with a private key |
|
|
109
|
+
| `verify [options] <address> <message> <signature>` | Verify a NOMS message signature |
|
|
106
110
|
|
|
107
111
|
### Advanced & RPC
|
|
108
112
|
|
|
109
|
-
| Command
|
|
110
|
-
|
|
111
|
-
| `rpc`
|
|
113
|
+
| Command | Description |
|
|
114
|
+
| ---------------------- | ----------------------------------------------------------------------------------------------------- |
|
|
115
|
+
| `rpc` | Query a Nano node RPC |
|
|
112
116
|
| `rpc probe-caps [url]` | Probe one or more comma-separated RPC URLs for JSON RPC, ledger-read, process, and remote PoW support |
|
|
113
|
-
| `block`
|
|
117
|
+
| `block` | Build unsigned Nano state blocks for manual/expert workflows |
|
|
114
118
|
|
|
115
119
|
### System
|
|
116
120
|
|
|
117
|
-
| Command | Description
|
|
118
|
-
|
|
119
|
-
| `diag`
|
|
120
|
-
| `mcp`
|
|
121
|
+
| Command | Description |
|
|
122
|
+
| ------- | ------------------------------------------------------------------------------------------------------- |
|
|
123
|
+
| `diag` | Show version, environment, effective RPC/work URLs, and local PoW recommendation without network probes |
|
|
124
|
+
| `mcp` | Start the MCP server or view configuration instructions |
|
|
121
125
|
|
|
122
126
|
All commands support `-j` / `--json` for machine-readable output.
|
|
123
127
|
|
|
@@ -132,7 +136,7 @@ Exposes Nano wallet functions as tools for AI agents (Claude Desktop, Cursor, Co
|
|
|
132
136
|
**Preferred** (global install — avoids `npx` concurrency handshake failures):
|
|
133
137
|
|
|
134
138
|
```bash
|
|
135
|
-
npm install -g xno-skills@
|
|
139
|
+
npm install -g xno-skills@5.0.0
|
|
136
140
|
```
|
|
137
141
|
|
|
138
142
|
```json
|
|
@@ -153,20 +157,19 @@ npm install -g xno-skills@4.7.5
|
|
|
153
157
|
"mcpServers": {
|
|
154
158
|
"nano": {
|
|
155
159
|
"command": "npx",
|
|
156
|
-
"args": ["-y", "-p", "xno-skills@
|
|
160
|
+
"args": ["-y", "-p", "xno-skills@5.0.0", "xno-mcp"]
|
|
157
161
|
}
|
|
158
162
|
}
|
|
159
163
|
}
|
|
160
164
|
```
|
|
161
165
|
|
|
162
|
-
|
|
163
166
|
### Client Setup Examples
|
|
164
167
|
|
|
165
168
|
<details>
|
|
166
169
|
<summary>Codex</summary>
|
|
167
170
|
|
|
168
171
|
```bash
|
|
169
|
-
# Preferred (after npm install -g xno-skills@
|
|
172
|
+
# Preferred (after npm install -g xno-skills@5.0.0):
|
|
170
173
|
codex mcp add nano \
|
|
171
174
|
-c sandbox_mode="danger-full-access" \
|
|
172
175
|
-c 'sandbox_permissions=["network-access"]' \
|
|
@@ -176,8 +179,9 @@ codex mcp add nano \
|
|
|
176
179
|
codex mcp add nano \
|
|
177
180
|
-c sandbox_mode="danger-full-access" \
|
|
178
181
|
-c 'sandbox_permissions=["network-access"]' \
|
|
179
|
-
-- npx -y -p xno-skills@
|
|
182
|
+
-- npx -y -p xno-skills@5.0.0 xno-mcp
|
|
180
183
|
```
|
|
184
|
+
|
|
181
185
|
</details>
|
|
182
186
|
|
|
183
187
|
<details>
|
|
@@ -193,6 +197,7 @@ codex mcp add nano \
|
|
|
193
197
|
}
|
|
194
198
|
}
|
|
195
199
|
```
|
|
200
|
+
|
|
196
201
|
</details>
|
|
197
202
|
|
|
198
203
|
<details>
|
|
@@ -205,11 +210,12 @@ codex mcp add nano \
|
|
|
205
210
|
"nano": {
|
|
206
211
|
"type": "local",
|
|
207
212
|
"command": ["xno-skills", "mcp"],
|
|
208
|
-
"enabled": true
|
|
209
|
-
}
|
|
210
|
-
}
|
|
213
|
+
"enabled": true,
|
|
214
|
+
},
|
|
215
|
+
},
|
|
211
216
|
}
|
|
212
217
|
```
|
|
218
|
+
|
|
213
219
|
</details>
|
|
214
220
|
|
|
215
221
|
<details>
|
|
@@ -225,6 +231,7 @@ codex mcp add nano \
|
|
|
225
231
|
}
|
|
226
232
|
}
|
|
227
233
|
```
|
|
234
|
+
|
|
228
235
|
</details>
|
|
229
236
|
|
|
230
237
|
<details>
|
|
@@ -240,6 +247,7 @@ codex mcp add nano \
|
|
|
240
247
|
}
|
|
241
248
|
}
|
|
242
249
|
```
|
|
250
|
+
|
|
243
251
|
</details>
|
|
244
252
|
|
|
245
253
|
<details>
|
|
@@ -256,6 +264,7 @@ codex mcp add nano \
|
|
|
256
264
|
}
|
|
257
265
|
}
|
|
258
266
|
```
|
|
267
|
+
|
|
259
268
|
</details>
|
|
260
269
|
|
|
261
270
|
## Library
|
|
@@ -277,6 +286,22 @@ npm test
|
|
|
277
286
|
npm run build
|
|
278
287
|
```
|
|
279
288
|
|
|
289
|
+
## Opt-in Codex wallet journey evaluation
|
|
290
|
+
|
|
291
|
+
This live evaluator makes ten real, owned transfers (five CLI and five MCP). It creates and retains the recipient wallets, places a local guard in front of the supplied Nano RPC, and writes raw Codex JSONL plus an independently checked report. Use only a dedicated source wallet whose balance meets the preflight requirements:
|
|
292
|
+
|
|
293
|
+
```bash
|
|
294
|
+
npm run eval:codex-wallet-journey -- --model <model> --source-wallet <name> --upstream-rpc <url> --out <private-output-dir>
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
For OpenCode’s Kilo Auto Free router, use the parallel command below. It runs `opencode run --format json --model kilo/kilo-auto/free` and requires the normal Kilo/OpenCode provider authentication or free-tier access:
|
|
298
|
+
|
|
299
|
+
```bash
|
|
300
|
+
npm run eval:opencode-wallet-journey -- --source-wallet <name> --upstream-rpc <url> --out <private-output-dir>
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
It is never part of CI or the release flow. The report deliberately makes no token-efficiency claim unless the captured Codex events provide an authoritative per-run token count.
|
|
304
|
+
|
|
280
305
|
## Releasing
|
|
281
306
|
|
|
282
307
|
See `RELEASING.md`.
|
package/bin/xno-mcp
CHANGED
package/dist/cjs/banner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.js","sourceRoot":"","sources":["../../src/banner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"banner.js","sourceRoot":"","sources":["../../src/banner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,OAAO,GAAG,wBAAwB,CAAC;AACzC,MAAM,MAAM,GAAG,wBAAwB,CAAC;AACxC,MAAM,MAAM,GAAG,uBAAuB,CAAC;AACvC,MAAM,QAAQ,GAAG,qBAAqB,CAAC;AACvC,MAAM,KAAK,GAAG,SAAS,CAAC;AACxB,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;kEAO2C,OAAO;;;iDAGxB;KAC9C,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC;KACxB,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC;KACvB,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC;KACvB,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;AAE7B,SAAS,iBAAiB;IACxB,OAAO,IAAI,CAAC;AACd,CAAC;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
package/dist/cjs/base32.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base32.d.ts","sourceRoot":"","sources":["../../src/base32.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAYH;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CA4BtD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,
|
|
1
|
+
{"version":3,"file":"base32.d.ts","sourceRoot":"","sources":["../../src/base32.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAYH;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CA4BtD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CA0CpD"}
|
package/dist/cjs/base32.js
CHANGED
|
@@ -81,8 +81,7 @@ export function base32Decode(str) {
|
|
|
81
81
|
for (let i = 0; i < str.length; i++) {
|
|
82
82
|
const char = str[i];
|
|
83
83
|
if (DECODE_MAP[char] === undefined) {
|
|
84
|
-
throw new Error(`Invalid Base32 character '${char}' at position ${i}. ` +
|
|
85
|
-
`Valid characters are: ${CHARSET}`);
|
|
84
|
+
throw new Error(`Invalid Base32 character '${char}' at position ${i}. ` + `Valid characters are: ${CHARSET}`);
|
|
86
85
|
}
|
|
87
86
|
}
|
|
88
87
|
// Calculate output length
|
package/dist/cjs/base32.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base32.js","sourceRoot":"","sources":["../../src/base32.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,OAAO,GAAG,kCAAkC,CAAC;AAEnD;;GAEG;AACH,MAAM,UAAU,GAA2B,EAAE,CAAC;AAC9C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;IACxC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAC7B,CAAC;AAED;;;;;;;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AG,CAAC,CAAC,CAAC,CAAC;QACpB,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;QAE/B,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC;QAC/B,IAAI,IAAI,CAAC,CAAC;QAEV,yBAAyB;QACzB,OAAO,IAAI,IAAI,CAAC,EAAE,CAAC;YACjB,IAAI,IAAI,CAAC,CAAC;YACV,MAAM,CAAC,SAAS,EAAE,CAAC,GAAG,CAAC,MAAM,IAAI,IAAI,CAAC,GAAG,IAAI,CAAC;QAChD,CAAC;IACH,CAAC;IAED,mEAAmE;IACnE,qEAAqE;IACrE,qDAAqD;IAErD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;AACpC,CAAC"}
|
package/dist/cjs/cli.js
CHANGED
|
@@ -3,106 +3,23 @@ import { Command } from 'commander';
|
|
|
3
3
|
import { validateAddress } from './validate.js';
|
|
4
4
|
import { nanoToRaw, rawToNano } from './convert.js';
|
|
5
5
|
import { generateAsciiQr, buildNanoUri, generateSvgQr } from './qr.js';
|
|
6
|
-
import { rpcAccountBalance, rpcAccountInfo, rpcReceivable,
|
|
6
|
+
import { rpcAccountBalance, rpcAccountInfo, rpcReceivable, rpcProbeCaps, } from './rpc.js';
|
|
7
7
|
import { decodeNanoAddress } from './nano-address.js';
|
|
8
8
|
import { nanoGetPublicKeyFromPrivateKey } from './ed25519-blake2b.js';
|
|
9
9
|
import { buildNanoStateBlockHex } from './state-block.js';
|
|
10
|
-
import {
|
|
11
|
-
import { clearPowTuningCache, createNodePowEngine, NanoClient, WorkProvider, NOMS, recommendLocalPow } from '@openrai/nano-core/node';
|
|
10
|
+
import { clearPowTuningCache, NOMS, recommendLocalPow } from '@openrai/nano-core/node';
|
|
12
11
|
import { version } from './version.js';
|
|
13
12
|
import { getSystemInfo, formatSystemInfo, getEffectiveLocalPowRecommended } from './meta.js';
|
|
14
|
-
import {
|
|
13
|
+
import { resolveEffectiveWorkUrls, resolveEffectiveRpcUrls, DEFAULT_RPC_URLS } from './config.js';
|
|
14
|
+
import { createNanoRuntime } from './nano-runtime.js';
|
|
15
15
|
import { DEFAULT_REPRESENTATIVE, DEFAULT_TIMEOUT_MS, executeChange, executeReceive, executeSend, getNanoBalance, getNanoHistory, getNanoAccountInfo, isRpcError, listNanoWallets, signWalletMessage, submitPreparedBlock, toToolError, verifyNanoMessage, } from './nano-actions.js';
|
|
16
16
|
import { loadConfig } from './state-store.js';
|
|
17
17
|
import { getAsciiArtBanner } from './banner.js';
|
|
18
18
|
const program = new Command();
|
|
19
19
|
const config = loadConfig();
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
function elapsedMs(startedAt) {
|
|
24
|
-
return Date.now() - startedAt;
|
|
25
|
-
}
|
|
26
|
-
function describeError(error) {
|
|
27
|
-
return error instanceof Error ? error.message : String(error);
|
|
28
|
-
}
|
|
29
|
-
function effectivePowTimeoutMs(config) {
|
|
30
|
-
return config.powTimeoutMs ?? (config.timeoutMs ? config.timeoutMs * 4 : 60_000);
|
|
31
|
-
}
|
|
32
|
-
function getNanoClient(options) {
|
|
33
|
-
const rpcUrls = options?.urls?.length ? options.urls : resolveEffectiveRpcUrls(undefined, config);
|
|
34
|
-
const rpcTimeoutMs = config.timeoutMs || DEFAULT_TIMEOUT_MS;
|
|
35
|
-
const powTimeoutMs = effectivePowTimeoutMs(config);
|
|
36
|
-
logTiming('xno-cli', `NanoClient init rpc=[${rpcUrls.map(redactUrlForLog).join(',') || '(defaults)'}] rpcTimeoutMs=${rpcTimeoutMs} powTimeoutMs=${powTimeoutMs}`);
|
|
37
|
-
return NanoClient.initialize({
|
|
38
|
-
rpc: rpcUrls.length > 0 ? rpcUrls : DEFAULT_RPC_URLS,
|
|
39
|
-
workProvider: WorkProvider.local({ localEngine: createNodePowEngine(), localTimeoutMs: powTimeoutMs }),
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
let localPowRecommendationLogged = false;
|
|
43
|
-
function readersFor(options) {
|
|
44
|
-
const client = getNanoClient(options);
|
|
45
|
-
const timeoutMs = config.timeoutMs || DEFAULT_TIMEOUT_MS;
|
|
46
|
-
return {
|
|
47
|
-
accountInfo: (address) => rpcAccountInfo(client, address, { timeoutMs }),
|
|
48
|
-
accountBalance: (address) => rpcAccountBalance(client, address, { timeoutMs }),
|
|
49
|
-
receivable: (address, count) => rpcReceivable(client, address, count, { timeoutMs }),
|
|
50
|
-
accountHistory: (address, count) => rpcAccountHistory(client, address, count, { timeoutMs }),
|
|
51
|
-
workGenerate: async (hash, difficulty) => {
|
|
52
|
-
let preferLocal = true;
|
|
53
|
-
try {
|
|
54
|
-
preferLocal = getEffectiveLocalPowRecommended(recommendLocalPow);
|
|
55
|
-
}
|
|
56
|
-
catch (e) {
|
|
57
|
-
// ignore
|
|
58
|
-
}
|
|
59
|
-
const workUrls = !preferLocal ? resolveEffectiveWorkUrls(config) : [];
|
|
60
|
-
if (!localPowRecommendationLogged) {
|
|
61
|
-
localPowRecommendationLogged = true;
|
|
62
|
-
if (preferLocal) {
|
|
63
|
-
logTiming('xno-cli', '(cached) Local PoW recommended');
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
const startedAt = Date.now();
|
|
67
|
-
if (workUrls.length > 0) {
|
|
68
|
-
const difficultyHex = normalizeRemoteWorkDifficulty(difficulty);
|
|
69
|
-
logTiming('xno-cli', `pow.generate start hash=${hash.slice(0, 12)} difficulty=${difficultyHex} remote=${workUrls.map(redactUrlForLog).join(',')}`);
|
|
70
|
-
try {
|
|
71
|
-
const workClient = getNanoClient({ urls: workUrls });
|
|
72
|
-
const res = await nanoRpcCall(workClient, { action: 'work_generate', hash, difficulty: difficultyHex }, { timeoutMs: effectivePowTimeoutMs(config) });
|
|
73
|
-
logTiming('xno-cli', `pow.generate ok remote elapsedMs=${elapsedMs(startedAt)}`);
|
|
74
|
-
return res.work;
|
|
75
|
-
}
|
|
76
|
-
catch (error) {
|
|
77
|
-
logTiming('xno-cli', `pow.generate remote fail elapsedMs=${elapsedMs(startedAt)} error=${describeError(error)}, falling back to local`);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
logTiming('xno-cli', `pow.generate start hash=${hash.slice(0, 12)} difficulty=${difficulty} local=true`);
|
|
81
|
-
try {
|
|
82
|
-
const work = await client.workProvider.generate(hash, difficulty);
|
|
83
|
-
logTiming('xno-cli', `pow.generate ok elapsedMs=${elapsedMs(startedAt)}`);
|
|
84
|
-
return work;
|
|
85
|
-
}
|
|
86
|
-
catch (error) {
|
|
87
|
-
logTiming('xno-cli', `pow.generate fail elapsedMs=${elapsedMs(startedAt)} error=${describeError(error)}`);
|
|
88
|
-
throw error;
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
process: async (block, subtype) => {
|
|
92
|
-
const startedAt = Date.now();
|
|
93
|
-
logTiming('xno-cli', `rpc.process start subtype=${subtype}`);
|
|
94
|
-
try {
|
|
95
|
-
const result = await rpcProcess(client, block, subtype, { timeoutMs });
|
|
96
|
-
logTiming('xno-cli', `rpc.process ok subtype=${subtype} elapsedMs=${elapsedMs(startedAt)} hash=${result.hash}`);
|
|
97
|
-
return result;
|
|
98
|
-
}
|
|
99
|
-
catch (error) {
|
|
100
|
-
logTiming('xno-cli', `rpc.process fail subtype=${subtype} elapsedMs=${elapsedMs(startedAt)} error=${describeError(error)}`);
|
|
101
|
-
throw error;
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
};
|
|
105
|
-
}
|
|
20
|
+
const runtime = createNanoRuntime({ getConfig: () => config, logScope: 'xno-cli' });
|
|
21
|
+
const getNanoClient = (options) => runtime.getNanoClient(options?.urls?.join(','));
|
|
22
|
+
const readersFor = (options) => runtime.readersFor(options?.urls?.join(','));
|
|
106
23
|
function printJsonOrText(result, options, text) {
|
|
107
24
|
if (options?.json) {
|
|
108
25
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -118,10 +35,7 @@ function exitWithError(error) {
|
|
|
118
35
|
console.error(result.content[0].text);
|
|
119
36
|
process.exit(1);
|
|
120
37
|
}
|
|
121
|
-
program
|
|
122
|
-
.version(version)
|
|
123
|
-
.description(getAsciiArtBanner())
|
|
124
|
-
.option('-q, --quiet', 'Suppress non-essential output');
|
|
38
|
+
program.version(version).description(getAsciiArtBanner()).option('-q, --quiet', 'Suppress non-essential output');
|
|
125
39
|
program.on('--help', () => {
|
|
126
40
|
// kept for subcommand compat
|
|
127
41
|
});
|
|
@@ -314,7 +228,9 @@ program
|
|
|
314
228
|
process.exit(1);
|
|
315
229
|
}
|
|
316
230
|
try {
|
|
317
|
-
const info = await getNanoAccountInfo({ wallet: options.wallet, address: options.address }, readersFor(), {
|
|
231
|
+
const info = await getNanoAccountInfo({ wallet: options.wallet, address: options.address }, readersFor(), {
|
|
232
|
+
config,
|
|
233
|
+
});
|
|
318
234
|
printJsonOrText(info, options, () => {
|
|
319
235
|
console.log(`Address: ${info.address}`);
|
|
320
236
|
console.log(`Balance: ${info.balanceXno} XNO`);
|
|
@@ -387,33 +303,38 @@ program
|
|
|
387
303
|
.argument('<from>', 'Source unit: xno or raw')
|
|
388
304
|
.option('-j, --json', 'Output in JSON format')
|
|
389
305
|
.action((amount, from, options) => {
|
|
390
|
-
|
|
391
|
-
const
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
306
|
+
try {
|
|
307
|
+
const normalizeUnit = (unit) => {
|
|
308
|
+
const value = unit.toLowerCase();
|
|
309
|
+
if (value === 'xno' || value === 'nano')
|
|
310
|
+
return 'xno';
|
|
311
|
+
if (value === 'raw' || value === 'rai')
|
|
312
|
+
return 'raw';
|
|
313
|
+
return value;
|
|
314
|
+
};
|
|
315
|
+
const fromUnit = normalizeUnit(from);
|
|
316
|
+
let rawValue;
|
|
317
|
+
switch (fromUnit) {
|
|
318
|
+
case 'xno':
|
|
319
|
+
rawValue = nanoToRaw(amount);
|
|
320
|
+
break;
|
|
321
|
+
case 'raw':
|
|
322
|
+
rawValue = amount;
|
|
323
|
+
break;
|
|
324
|
+
default:
|
|
325
|
+
console.error(`Unknown source unit: ${fromUnit}. Use xno or raw.`);
|
|
326
|
+
process.exit(1);
|
|
327
|
+
}
|
|
328
|
+
const xno = rawToNano(rawValue);
|
|
329
|
+
const result = { input: amount, inputUnit: fromUnit, raw: rawValue, xno };
|
|
330
|
+
printJsonOrText(result, options, () => {
|
|
331
|
+
console.log(`raw: ${rawValue}`);
|
|
332
|
+
console.log(`xno: ${xno}`);
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
catch (error) {
|
|
336
|
+
exitWithError(error);
|
|
410
337
|
}
|
|
411
|
-
const xno = rawToNano(rawValue);
|
|
412
|
-
const result = { input: amount, inputUnit: fromUnit, raw: rawValue, xno };
|
|
413
|
-
printJsonOrText(result, options, () => {
|
|
414
|
-
console.log(`raw: ${rawValue}`);
|
|
415
|
-
console.log(`xno: ${xno}`);
|
|
416
|
-
});
|
|
417
338
|
});
|
|
418
339
|
program
|
|
419
340
|
.command('qr')
|
|
@@ -429,10 +350,16 @@ program
|
|
|
429
350
|
console.error(`Invalid address: ${validation.error}`);
|
|
430
351
|
process.exit(1);
|
|
431
352
|
}
|
|
353
|
+
// The kind check lives in formatNanoUri (src/qr.ts) now: the QR is built by
|
|
354
|
+
// buildNanoUri/generateAsciiQr/generateSvgQr, so one check there covers the CLI,
|
|
355
|
+
// the MCP tool and anyone importing buildNanoUri. Anything it refuses is caught by
|
|
356
|
+
// the try/catch below and routed through exitWithError.
|
|
432
357
|
try {
|
|
433
358
|
const content = buildNanoUri(address, options.amountXno);
|
|
434
359
|
const format = options.format === 'svg' ? 'svg' : 'ascii';
|
|
435
|
-
const qr = format === 'svg'
|
|
360
|
+
const qr = format === 'svg'
|
|
361
|
+
? generateSvgQr(address, options.amountXno)
|
|
362
|
+
: await generateAsciiQr(address, options.amountXno);
|
|
436
363
|
printJsonOrText({ address, amountXno: options.amountXno ?? null, content, format, qr }, options, () => {
|
|
437
364
|
console.log(qr);
|
|
438
365
|
});
|
|
@@ -445,12 +372,12 @@ program
|
|
|
445
372
|
program
|
|
446
373
|
.command('validate')
|
|
447
374
|
.helpGroup('Utilities')
|
|
448
|
-
.description('Validate a Nano address
|
|
449
|
-
.argument('<input>', '
|
|
375
|
+
.description('Validate a Nano address')
|
|
376
|
+
.argument('<input>', 'Nano address to validate')
|
|
450
377
|
.option('-j, --json', 'Output in JSON format')
|
|
451
378
|
.action((input, options) => {
|
|
452
379
|
const result = validateAddress(input);
|
|
453
|
-
const out = {
|
|
380
|
+
const out = { input, ...result };
|
|
454
381
|
printJsonOrText(out, options, () => {
|
|
455
382
|
if (result.valid) {
|
|
456
383
|
console.log('Valid Nano address');
|
|
@@ -553,7 +480,9 @@ rpcCmd
|
|
|
553
480
|
.action(async (address, options) => {
|
|
554
481
|
try {
|
|
555
482
|
const client = getNanoClient({ urls: options.url ? options.url.split(',').filter(Boolean) : undefined });
|
|
556
|
-
const items = await rpcReceivable(client, address, options.count, {
|
|
483
|
+
const items = await rpcReceivable(client, address, options.count, {
|
|
484
|
+
timeoutMs: config.timeoutMs || DEFAULT_TIMEOUT_MS,
|
|
485
|
+
});
|
|
557
486
|
printJsonOrText({ account: address, blocks: items }, options, () => {
|
|
558
487
|
if (items.length === 0) {
|
|
559
488
|
console.log('No receivable blocks.');
|
|
@@ -665,7 +594,10 @@ rpcCmd
|
|
|
665
594
|
exitWithError(error);
|
|
666
595
|
}
|
|
667
596
|
});
|
|
668
|
-
const blockCmd = program
|
|
597
|
+
const blockCmd = program
|
|
598
|
+
.command('block')
|
|
599
|
+
.helpGroup('Advanced & RPC')
|
|
600
|
+
.description('Build unsigned Nano state blocks for manual/expert workflows');
|
|
669
601
|
const ZERO_HASH = '0'.repeat(64);
|
|
670
602
|
blockCmd
|
|
671
603
|
.command('send')
|
|
@@ -732,7 +664,9 @@ blockCmd
|
|
|
732
664
|
process.exit(1);
|
|
733
665
|
}
|
|
734
666
|
if (!hash) {
|
|
735
|
-
const pending = await rpcReceivable(client, options.account, 1, {
|
|
667
|
+
const pending = await rpcReceivable(client, options.account, 1, {
|
|
668
|
+
timeoutMs: config.timeoutMs || DEFAULT_TIMEOUT_MS,
|
|
669
|
+
});
|
|
736
670
|
if (pending.length === 0) {
|
|
737
671
|
console.error('Error: no receivable blocks found for this account.');
|
|
738
672
|
process.exit(1);
|
|
@@ -741,7 +675,9 @@ blockCmd
|
|
|
741
675
|
amountRaw = amountRaw || pending[0].amount;
|
|
742
676
|
console.error(`Auto-detected pending block: ${hash} (${rawToNano(amountRaw)} XNO)`);
|
|
743
677
|
}
|
|
744
|
-
let info = await rpcAccountInfo(client, options.account, {
|
|
678
|
+
let info = await rpcAccountInfo(client, options.account, {
|
|
679
|
+
timeoutMs: config.timeoutMs || DEFAULT_TIMEOUT_MS,
|
|
680
|
+
}).catch(() => ({ error: 'Account not found' }));
|
|
745
681
|
const opened = !isRpcError(info);
|
|
746
682
|
const previous = opened ? info.frontier : ZERO_HASH;
|
|
747
683
|
const currentBalance = opened ? BigInt(info.balance) : 0n;
|
|
@@ -752,7 +688,14 @@ blockCmd
|
|
|
752
688
|
balanceRaw: (currentBalance + BigInt(amountRaw)).toString(),
|
|
753
689
|
link: hash,
|
|
754
690
|
});
|
|
755
|
-
printJsonOrText({
|
|
691
|
+
printJsonOrText({
|
|
692
|
+
blockHex,
|
|
693
|
+
account: options.account,
|
|
694
|
+
sendBlockHash: hash,
|
|
695
|
+
amountRaw,
|
|
696
|
+
previous,
|
|
697
|
+
subtype: opened ? 'receive' : 'open',
|
|
698
|
+
}, options, () => console.log(blockHex));
|
|
756
699
|
}
|
|
757
700
|
catch (error) {
|
|
758
701
|
exitWithError(error);
|
|
@@ -796,7 +739,7 @@ Configuration for popular AI agent harnesses:
|
|
|
796
739
|
|
|
797
740
|
Preferred (global install — avoids npx concurrency handshake failures):
|
|
798
741
|
|
|
799
|
-
npm install -g xno-skills@
|
|
742
|
+
npm install -g xno-skills@5.0.0
|
|
800
743
|
|
|
801
744
|
1. Claude Desktop / Cursor / Roo Code (in config.json):
|
|
802
745
|
{
|
|
@@ -821,16 +764,16 @@ Fallback (if global install is not possible):
|
|
|
821
764
|
"mcpServers": {
|
|
822
765
|
"xno": {
|
|
823
766
|
"command": "npx",
|
|
824
|
-
"args": ["-y", "xno-skills@
|
|
767
|
+
"args": ["-y", "xno-skills@5.0.0", "mcp"]
|
|
825
768
|
}
|
|
826
769
|
}
|
|
827
770
|
}
|
|
828
771
|
|
|
829
772
|
2. Gemini CLI:
|
|
830
|
-
gemini mcp add xno npx -y xno-skills@
|
|
773
|
+
gemini mcp add xno npx -y xno-skills@5.0.0 mcp
|
|
831
774
|
|
|
832
775
|
3. Claude Code:
|
|
833
|
-
claude mcp add xno npx -y xno-skills@
|
|
776
|
+
claude mcp add xno npx -y xno-skills@5.0.0 mcp
|
|
834
777
|
|
|
835
778
|
To run the MCP server directly in this terminal:
|
|
836
779
|
xno-skills mcp (if globally installed)
|