paytaca-cli 0.1.0 → 0.3.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 +91 -12
- package/dist/commands/address.d.ts +2 -0
- package/dist/commands/address.d.ts.map +1 -1
- package/dist/commands/address.js +19 -4
- package/dist/commands/address.js.map +1 -1
- package/dist/commands/balance.d.ts +2 -0
- package/dist/commands/balance.d.ts.map +1 -1
- package/dist/commands/balance.js +58 -12
- package/dist/commands/balance.js.map +1 -1
- package/dist/commands/check.d.ts +14 -0
- package/dist/commands/check.d.ts.map +1 -0
- package/dist/commands/check.js +162 -0
- package/dist/commands/check.js.map +1 -0
- package/dist/commands/claude.d.ts +9 -0
- package/dist/commands/claude.d.ts.map +1 -0
- package/dist/commands/claude.js +20 -0
- package/dist/commands/claude.js.map +1 -0
- package/dist/commands/history.d.ts +2 -0
- package/dist/commands/history.d.ts.map +1 -1
- package/dist/commands/history.js +40 -7
- package/dist/commands/history.js.map +1 -1
- package/dist/commands/opencode.d.ts +9 -0
- package/dist/commands/opencode.d.ts.map +1 -0
- package/dist/commands/opencode.js +20 -0
- package/dist/commands/opencode.js.map +1 -0
- package/dist/commands/pay.d.ts +17 -0
- package/dist/commands/pay.d.ts.map +1 -0
- package/dist/commands/pay.js +347 -0
- package/dist/commands/pay.js.map +1 -0
- package/dist/commands/receive.d.ts +9 -1
- package/dist/commands/receive.d.ts.map +1 -1
- package/dist/commands/receive.js +117 -8
- package/dist/commands/receive.js.map +1 -1
- package/dist/commands/token.d.ts +16 -0
- package/dist/commands/token.d.ts.map +1 -0
- package/dist/commands/token.js +351 -0
- package/dist/commands/token.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +13 -3
- package/dist/index.js.map +1 -1
- package/dist/types/x402.d.ts +72 -0
- package/dist/types/x402.d.ts.map +1 -0
- package/dist/types/x402.js +9 -0
- package/dist/types/x402.js.map +1 -0
- package/dist/utils/skill.d.ts +17 -0
- package/dist/utils/skill.d.ts.map +1 -0
- package/dist/utils/skill.js +100 -0
- package/dist/utils/skill.js.map +1 -0
- package/dist/utils/x402.d.ts +17 -0
- package/dist/utils/x402.d.ts.map +1 -0
- package/dist/utils/x402.js +119 -0
- package/dist/utils/x402.js.map +1 -0
- package/dist/utils/x402.test.d.ts +2 -0
- package/dist/utils/x402.test.d.ts.map +1 -0
- package/dist/utils/x402.test.js +216 -0
- package/dist/utils/x402.test.js.map +1 -0
- package/dist/wallet/bch.d.ts +110 -3
- package/dist/wallet/bch.d.ts.map +1 -1
- package/dist/wallet/bch.js +214 -2
- package/dist/wallet/bch.js.map +1 -1
- package/dist/wallet/keys.d.ts +8 -0
- package/dist/wallet/keys.d.ts.map +1 -1
- package/dist/wallet/keys.js +10 -0
- package/dist/wallet/keys.js.map +1 -1
- package/dist/wallet/x402.d.ts +29 -0
- package/dist/wallet/x402.d.ts.map +1 -0
- package/dist/wallet/x402.js +45 -0
- package/dist/wallet/x402.js.map +1 -0
- package/package.json +8 -2
- package/skills/paytaca/SKILL.md +123 -0
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A command-line interface for the Paytaca [Bitcoin Cash](https://bitcoincash.org) (BCH) wallet. Built with the same core logic as the [Paytaca mobile app](https://github.com/paytaca/paytaca-app), using [watchtower-cash-js](https://github.com/paytaca/watchtower-cash-js) for transaction operations and [libauth](https://github.com/bitauth/libauth) for HD key derivation.
|
|
4
4
|
|
|
5
|
-
Bitcoin Cash is peer-to-peer electronic cash, enabling fast, low-fee transactions for everyday use. Paytaca CLI brings the full capabilities of the Paytaca wallet to the terminal — create wallets, derive addresses, send and receive BCH, and view transaction history, all from the command line.
|
|
5
|
+
Bitcoin Cash is peer-to-peer electronic cash, enabling fast, low-fee transactions for everyday use. Paytaca CLI brings the full capabilities of the Paytaca wallet to the terminal — create wallets, derive addresses, send and receive BCH, manage CashTokens (fungible tokens and NFTs), and view transaction history, all from the command line.
|
|
6
6
|
|
|
7
7
|
Designed to be AI agent-friendly and useful for automation by power users.
|
|
8
8
|
|
|
@@ -13,13 +13,19 @@ Designed to be AI agent-friendly and useful for automation by power users.
|
|
|
13
13
|
## Installation
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
|
|
16
|
+
npm install -g paytaca-cli
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Or install from source:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
git clone https://github.com/paytaca/paytaca-cli.git && cd paytaca-cli
|
|
17
23
|
npm install
|
|
18
24
|
npm run build
|
|
19
25
|
npm link
|
|
20
26
|
```
|
|
21
27
|
|
|
22
|
-
After
|
|
28
|
+
After installing, the `paytaca` command is available globally.
|
|
23
29
|
|
|
24
30
|
## Commands
|
|
25
31
|
|
|
@@ -38,15 +44,20 @@ paytaca wallet export # Display the stored seed phrase
|
|
|
38
44
|
```bash
|
|
39
45
|
paytaca balance # Show BCH balance (BCH + sats)
|
|
40
46
|
paytaca balance --sats # Show in satoshis only
|
|
47
|
+
paytaca balance --token <category> # Show balance for a specific CashToken
|
|
41
48
|
paytaca balance --chipnet # Query chipnet balance
|
|
42
49
|
```
|
|
43
50
|
|
|
44
51
|
### Receive
|
|
45
52
|
|
|
46
53
|
```bash
|
|
47
|
-
paytaca receive
|
|
48
|
-
paytaca receive 3
|
|
49
|
-
paytaca receive --no-qr
|
|
54
|
+
paytaca receive # Show receiving address with QR code
|
|
55
|
+
paytaca receive --index 3 # Show address at index 3
|
|
56
|
+
paytaca receive --no-qr # Address only, no QR code
|
|
57
|
+
paytaca receive --amount 0.5 # BIP21 URI with BCH amount
|
|
58
|
+
paytaca receive --token # Token-aware z-prefix address
|
|
59
|
+
paytaca receive --token <category> # PayPro URI for a specific token
|
|
60
|
+
paytaca receive --token <category> --amount 100 # PayPro URI with token amount
|
|
50
61
|
```
|
|
51
62
|
|
|
52
63
|
### Send
|
|
@@ -64,6 +75,7 @@ paytaca history # Show recent transactions
|
|
|
64
75
|
paytaca history --sats # Amounts in satoshis
|
|
65
76
|
paytaca history --type incoming # Filter: incoming, outgoing, or all
|
|
66
77
|
paytaca history --page 2 # Pagination
|
|
78
|
+
paytaca history --token <category> # Filter by CashToken category
|
|
67
79
|
```
|
|
68
80
|
|
|
69
81
|
### Address
|
|
@@ -71,10 +83,52 @@ paytaca history --page 2 # Pagination
|
|
|
71
83
|
```bash
|
|
72
84
|
paytaca address derive # Derive address at index 0
|
|
73
85
|
paytaca address derive 5 # Derive address at index 5
|
|
86
|
+
paytaca address derive --token # Derive token-aware z-prefix address
|
|
74
87
|
paytaca address list # List first 5 addresses
|
|
75
88
|
paytaca address list -n 20 # List first 20 addresses
|
|
89
|
+
paytaca address list --token # List token-aware z-prefix addresses
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### CashTokens
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
paytaca token list # List fungible tokens with balances
|
|
96
|
+
paytaca token info <category> # Token metadata, balance, and NFTs
|
|
97
|
+
paytaca token send <address> <amount> --token <cat> # Send fungible tokens
|
|
98
|
+
paytaca token send-nft <address> --token <cat> --commitment <hex> # Send an NFT
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### x402 Payments
|
|
102
|
+
|
|
103
|
+
The x402 protocol enables HTTP payments via BCH. Some APIs (like nanogpt) require payment to access.
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
paytaca check <url> # Check if URL requires payment, shows estimated cost
|
|
107
|
+
paytaca pay <url> # Make a paid HTTP request (handles 402 automatically)
|
|
108
|
+
paytaca pay <url> --json # JSON output (recommended for AI agents)
|
|
109
|
+
paytaca pay <url> --dry-run # Preview payment without executing
|
|
110
|
+
paytaca pay <url> --method POST # POST request with body
|
|
111
|
+
paytaca pay <url> --body '{"prompt":"hello"}'
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Example workflow:**
|
|
115
|
+
```bash
|
|
116
|
+
paytaca check https://api.nanogpt.com/v1/complete --json
|
|
117
|
+
# → {"paymentRequired": true, "estimatedCostSats": "100"}
|
|
118
|
+
|
|
119
|
+
paytaca pay https://api.nanogpt.com/v1/complete --method POST --body '{"prompt":"hello"}'
|
|
120
|
+
# → Handles 402 → pays → returns response
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### AI Agent Integration
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
paytaca opencode # Install Paytaca x402 skill for OpenCode AI agents
|
|
127
|
+
paytaca claude # Install Paytaca x402 skill for Claude Code agents
|
|
76
128
|
```
|
|
77
129
|
|
|
130
|
+
This enables AI agents to autonomously handle HTTP 402 payment responses when calling x402-enabled APIs.
|
|
131
|
+
|
|
78
132
|
## Network
|
|
79
133
|
|
|
80
134
|
All commands default to **mainnet**. Pass `--chipnet` for testnet:
|
|
@@ -101,20 +155,29 @@ Powered by [@napi-rs/keyring](https://github.com/Brooooooklyn/keyring-node) (pre
|
|
|
101
155
|
src/
|
|
102
156
|
commands/ CLI command definitions (Commander.js)
|
|
103
157
|
wallet.ts wallet create | import | info | export
|
|
104
|
-
balance.ts balance display
|
|
105
|
-
receive.ts receiving address + QR code
|
|
158
|
+
balance.ts balance display (BCH and CashTokens)
|
|
159
|
+
receive.ts receiving address + QR code + payment URIs
|
|
106
160
|
send.ts BCH sending
|
|
107
|
-
history.ts transaction history
|
|
108
|
-
address.ts HD address derivation
|
|
161
|
+
history.ts transaction history (BCH and CashTokens)
|
|
162
|
+
address.ts HD address derivation (standard and z-prefix)
|
|
163
|
+
token.ts CashToken commands (list, info, send, send-nft)
|
|
164
|
+
pay.ts x402 BCH payment handler for HTTP requests
|
|
165
|
+
check.ts Check if URL requires x402 payment
|
|
166
|
+
opencode.ts Install x402 skill for OpenCode AI agents
|
|
167
|
+
claude.ts Install x402 skill for Claude Code AI agents
|
|
109
168
|
wallet/
|
|
110
169
|
index.ts Wallet class, mnemonic gen/import/load
|
|
111
|
-
bch.ts BchWallet (balance, send, history,
|
|
112
|
-
keys.ts LibauthHDWallet (HD key derivation)
|
|
170
|
+
bch.ts BchWallet (balance, send, history, CashTokens)
|
|
171
|
+
keys.ts LibauthHDWallet (HD key derivation, token addresses)
|
|
172
|
+
x402.ts X402Payer (BCH payment signing and verification)
|
|
113
173
|
storage/
|
|
114
174
|
keychain.ts OS keychain wrapper (@napi-rs/keyring)
|
|
115
175
|
utils/
|
|
116
176
|
crypto.ts pubkey -> CashAddress pipeline
|
|
117
177
|
network.ts Watchtower URLs, derivation paths
|
|
178
|
+
x402.ts x402 header parsing, payment requirement selection
|
|
179
|
+
types/
|
|
180
|
+
x402.ts x402 payment types (PaymentRequired, PaymentPayload, etc.)
|
|
118
181
|
```
|
|
119
182
|
|
|
120
183
|
## Key Dependencies
|
|
@@ -137,6 +200,22 @@ npm run build # One-time build
|
|
|
137
200
|
npm run clean # Remove dist/
|
|
138
201
|
```
|
|
139
202
|
|
|
203
|
+
## x402 Server
|
|
204
|
+
|
|
205
|
+
A reference x402 server implementation is included for testing:
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
cd x402-server
|
|
209
|
+
npm install
|
|
210
|
+
npm run dev # Start dev server on port 3001
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
The server implements the x402-bch v2.2 specification and provides:
|
|
214
|
+
- `GET /api/quote` — Returns a quote (requires payment)
|
|
215
|
+
- `POST /api/generate` — Text generation endpoint (requires payment)
|
|
216
|
+
|
|
217
|
+
Useful for testing the `paytaca pay` workflow locally.
|
|
218
|
+
|
|
140
219
|
## License
|
|
141
220
|
|
|
142
221
|
Copyright Paytaca Inc. 2021. All rights reserved. See [LICENSE](LICENSE) for details.
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* Derives Bitcoin Cash addresses from the stored seed phrase
|
|
5
5
|
* using the HD path m/44'/145'/0'/0/{index} (receiving)
|
|
6
6
|
* and m/44'/145'/0'/1/{index} (change).
|
|
7
|
+
*
|
|
8
|
+
* Use --token to derive token-aware (z-prefix) addresses for CashTokens.
|
|
7
9
|
*/
|
|
8
10
|
import { Command } from 'commander';
|
|
9
11
|
export declare function registerAddressCommands(program: Command): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src/commands/address.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src/commands/address.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAInC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA+F9D"}
|
package/dist/commands/address.js
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* Derives Bitcoin Cash addresses from the stored seed phrase
|
|
5
5
|
* using the HD path m/44'/145'/0'/0/{index} (receiving)
|
|
6
6
|
* and m/44'/145'/0'/1/{index} (change).
|
|
7
|
+
*
|
|
8
|
+
* Use --token to derive token-aware (z-prefix) addresses for CashTokens.
|
|
7
9
|
*/
|
|
8
10
|
import chalk from 'chalk';
|
|
9
11
|
import { loadWallet, loadMnemonic } from '../wallet/index.js';
|
|
@@ -17,8 +19,10 @@ export function registerAddressCommands(program) {
|
|
|
17
19
|
.description('Derive receiving and change addresses at a given index')
|
|
18
20
|
.argument('[index]', 'Address index (default: 0)', '0')
|
|
19
21
|
.option('--chipnet', 'Use chipnet (testnet) instead of mainnet')
|
|
22
|
+
.option('--token', 'Show token-aware (z-prefix) addresses for CashTokens')
|
|
20
23
|
.action((_index, opts) => {
|
|
21
24
|
const isChipnet = Boolean(opts.chipnet);
|
|
25
|
+
const isToken = Boolean(opts.token);
|
|
22
26
|
const index = parseInt(_index, 10);
|
|
23
27
|
if (isNaN(index) || index < 0) {
|
|
24
28
|
console.log(chalk.red('\nError: Index must be a non-negative integer.\n'));
|
|
@@ -32,10 +36,16 @@ export function registerAddressCommands(program) {
|
|
|
32
36
|
const w = loadWallet();
|
|
33
37
|
const bchWallet = w.forNetwork(isChipnet);
|
|
34
38
|
const network = isChipnet ? 'chipnet' : 'mainnet';
|
|
35
|
-
const addressSet =
|
|
36
|
-
|
|
39
|
+
const addressSet = isToken
|
|
40
|
+
? bchWallet.getTokenAddressSetAt(index)
|
|
41
|
+
: bchWallet.getAddressSetAt(index);
|
|
42
|
+
const label = isToken ? 'Token address' : 'Address';
|
|
43
|
+
console.log(chalk.bold(`\n ${label} at index ${index} (${network})\n`));
|
|
37
44
|
console.log(` Receiving: ${addressSet.receiving}`);
|
|
38
45
|
console.log(chalk.dim(` Change: ${addressSet.change}`));
|
|
46
|
+
if (isToken) {
|
|
47
|
+
console.log(chalk.dim(' Type: token-aware (z-prefix)'));
|
|
48
|
+
}
|
|
39
49
|
console.log();
|
|
40
50
|
});
|
|
41
51
|
// ── address list ───────────────────────────────────────────────────────
|
|
@@ -44,8 +54,10 @@ export function registerAddressCommands(program) {
|
|
|
44
54
|
.description('List derived receiving addresses')
|
|
45
55
|
.option('-n, --count <count>', 'Number of addresses to derive', '5')
|
|
46
56
|
.option('--chipnet', 'Use chipnet (testnet) instead of mainnet')
|
|
57
|
+
.option('--token', 'Show token-aware (z-prefix) addresses for CashTokens')
|
|
47
58
|
.action((_opts) => {
|
|
48
59
|
const isChipnet = Boolean(_opts.chipnet);
|
|
60
|
+
const isToken = Boolean(_opts.token);
|
|
49
61
|
const count = parseInt(_opts.count, 10);
|
|
50
62
|
if (isNaN(count) || count < 1) {
|
|
51
63
|
console.log(chalk.red('\nError: Count must be a positive integer.\n'));
|
|
@@ -59,11 +71,14 @@ export function registerAddressCommands(program) {
|
|
|
59
71
|
const w = loadWallet();
|
|
60
72
|
const bchWallet = w.forNetwork(isChipnet);
|
|
61
73
|
const network = isChipnet ? 'chipnet' : 'mainnet';
|
|
62
|
-
|
|
74
|
+
const typeLabel = isToken ? 'Token Addresses' : 'Addresses';
|
|
75
|
+
console.log(chalk.bold(`\n ${typeLabel} (${network})\n`));
|
|
63
76
|
console.log(chalk.dim(` ${'Index'.padEnd(8)}${'Receiving Address'}`));
|
|
64
77
|
console.log(chalk.dim(` ${'─'.repeat(70)}`));
|
|
65
78
|
for (let i = 0; i < count; i++) {
|
|
66
|
-
const addressSet =
|
|
79
|
+
const addressSet = isToken
|
|
80
|
+
? bchWallet.getTokenAddressSetAt(i)
|
|
81
|
+
: bchWallet.getAddressSetAt(i);
|
|
67
82
|
console.log(` ${String(i).padEnd(8)}${addressSet.receiving}`);
|
|
68
83
|
}
|
|
69
84
|
console.log();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../src/commands/address.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../src/commands/address.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAE7D,MAAM,UAAU,uBAAuB,CAAC,OAAgB;IACtD,MAAM,OAAO,GAAG,OAAO;SACpB,OAAO,CAAC,SAAS,CAAC;SAClB,WAAW,CAAC,+BAA+B,CAAC,CAAA;IAE/C,0EAA0E;IAC1E,OAAO;SACJ,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,wDAAwD,CAAC;SACrE,QAAQ,CAAC,SAAS,EAAE,4BAA4B,EAAE,GAAG,CAAC;SACtD,MAAM,CAAC,WAAW,EAAE,0CAA0C,CAAC;SAC/D,MAAM,CAAC,SAAS,EAAE,sDAAsD,CAAC;SACzE,MAAM,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE;QACvB,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QACvC,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACnC,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,EAAE,EAAE,CA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,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,WAAW,CAAA;QAC3D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,SAAS,KAAK,OAAO,KAAK,CAAC,CAAC,CAAA;QAC3D,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,GAAG,CACP,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,mBAAmB,EAAE,CAChD,CACF,CAAA;QACD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;QAE9C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;YAC/B,MAAM,UAAU,GAAG,OAAO;gBACxB,CAAC,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC,CAAC;gBACnC,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC,CAAA;YAChC,OAAO,CAAC,GAAG,CAAC,MAAM,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,SAAS,EAAE,CAAC,CAAA;QACjE,CAAC;QAED,OAAO,CAAC,GAAG,EAAE,CAAA;IACf,CAAC,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* Displays the BCH balance for the current wallet.
|
|
5
5
|
* Shows both BCH and satoshi denominations, plus spendable vs total
|
|
6
6
|
* when they differ (e.g. unconfirmed UTXOs).
|
|
7
|
+
*
|
|
8
|
+
* Use --token <category> to display the balance for a specific CashToken.
|
|
7
9
|
*/
|
|
8
10
|
import { Command } from 'commander';
|
|
9
11
|
export declare function registerBalanceCommand(program: Command): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"balance.d.ts","sourceRoot":"","sources":["../../src/commands/balance.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"balance.d.ts","sourceRoot":"","sources":["../../src/commands/balance.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAcnC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA0H7D"}
|
package/dist/commands/balance.js
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* Displays the BCH balance for the current wallet.
|
|
5
5
|
* Shows both BCH and satoshi denominations, plus spendable vs total
|
|
6
6
|
* when they differ (e.g. unconfirmed UTXOs).
|
|
7
|
+
*
|
|
8
|
+
* Use --token <category> to display the balance for a specific CashToken.
|
|
7
9
|
*/
|
|
8
10
|
import chalk from 'chalk';
|
|
9
11
|
import { loadWallet, loadMnemonic } from '../wallet/index.js';
|
|
@@ -20,11 +22,17 @@ export function registerBalanceCommand(program) {
|
|
|
20
22
|
.command('balance')
|
|
21
23
|
.description('Display wallet balance')
|
|
22
24
|
.option('--chipnet', 'Use chipnet (testnet) instead of mainnet')
|
|
25
|
+
.option('--token <id>', 'Show balance for a specific CashToken category (64-character hex)')
|
|
23
26
|
.option('--sats', 'Display balance in satoshis only')
|
|
24
27
|
.action(async (opts) => {
|
|
25
28
|
const isChipnet = Boolean(opts.chipnet);
|
|
26
29
|
const showSatsOnly = Boolean(opts.sats);
|
|
27
30
|
const network = isChipnet ? 'chipnet' : 'mainnet';
|
|
31
|
+
const tokenId = opts.token || '';
|
|
32
|
+
if (tokenId && !/^[a-fA-F0-9]{64}$/.test(tokenId)) {
|
|
33
|
+
console.log(chalk.red('\nError: Token must be a 64-character hex string.\n'));
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
28
36
|
// ── Validate wallet ──────────────────────────────────────────────
|
|
29
37
|
const data = loadMnemonic();
|
|
30
38
|
if (!data) {
|
|
@@ -33,23 +41,61 @@ export function registerBalanceCommand(program) {
|
|
|
33
41
|
}
|
|
34
42
|
const w = loadWallet();
|
|
35
43
|
const bchWallet = w.forNetwork(isChipnet);
|
|
36
|
-
console.log(chalk.bold(`\n Balance (${network})\n`));
|
|
37
44
|
try {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
45
|
+
if (tokenId) {
|
|
46
|
+
// ── Token balance ────────────────────────────────────────────
|
|
47
|
+
let tokenName = '';
|
|
48
|
+
let tokenSymbol = '';
|
|
49
|
+
let decimals = 0;
|
|
50
|
+
try {
|
|
51
|
+
const info = await bchWallet.getTokenInfo(tokenId);
|
|
52
|
+
if (info) {
|
|
53
|
+
tokenName = info.name !== 'Unknown Token' ? info.name : '';
|
|
54
|
+
tokenSymbol = info.symbol || '';
|
|
55
|
+
decimals = info.decimals || 0;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
// Token info unavailable — proceed without metadata
|
|
60
|
+
}
|
|
61
|
+
const label = tokenSymbol || tokenName || 'Token';
|
|
62
|
+
console.log(chalk.bold(`\n ${label} Balance (${network})\n`));
|
|
63
|
+
console.log(chalk.dim(` Category: ${tokenId}`));
|
|
64
|
+
if (tokenName) {
|
|
65
|
+
console.log(chalk.dim(` Name: ${tokenName}`));
|
|
66
|
+
}
|
|
67
|
+
const result = await bchWallet.getTokenBalance(tokenId);
|
|
68
|
+
const displayBalance = decimals > 0
|
|
69
|
+
? (result.balance / 10 ** decimals)
|
|
70
|
+
: result.balance;
|
|
71
|
+
const displaySpendable = decimals > 0
|
|
72
|
+
? (result.spendable / 10 ** decimals)
|
|
73
|
+
: result.spendable;
|
|
74
|
+
const unit = tokenSymbol || 'tokens';
|
|
75
|
+
console.log(` Balance: ${displayBalance} ${unit}`);
|
|
43
76
|
if (result.spendable !== result.balance) {
|
|
44
|
-
console.log(chalk.dim(` Spendable: ${
|
|
77
|
+
console.log(chalk.dim(` Spendable: ${displaySpendable} ${unit}`));
|
|
45
78
|
}
|
|
46
79
|
}
|
|
47
80
|
else {
|
|
48
|
-
|
|
49
|
-
console.log(chalk.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
81
|
+
// ── BCH balance ──────────────────────────────────────────────
|
|
82
|
+
console.log(chalk.bold(`\n Balance (${network})\n`));
|
|
83
|
+
const result = await bchWallet.getBalance();
|
|
84
|
+
const balanceSats = bchToSats(result.balance);
|
|
85
|
+
const spendableSats = bchToSats(result.spendable);
|
|
86
|
+
if (showSatsOnly) {
|
|
87
|
+
console.log(` Balance: ${formatSats(balanceSats)} sats`);
|
|
88
|
+
if (result.spendable !== result.balance) {
|
|
89
|
+
console.log(chalk.dim(` Spendable: ${formatSats(spendableSats)} sats`));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
console.log(` Balance: ${result.balance} BCH`);
|
|
94
|
+
console.log(chalk.dim(` ${formatSats(balanceSats)} sats`));
|
|
95
|
+
if (result.spendable !== result.balance) {
|
|
96
|
+
console.log(` Spendable: ${result.spendable} BCH`);
|
|
97
|
+
console.log(chalk.dim(` ${formatSats(spendableSats)} sats`));
|
|
98
|
+
}
|
|
53
99
|
}
|
|
54
100
|
}
|
|
55
101
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"balance.js","sourceRoot":"","sources":["../../src/commands/balance.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"balance.js","sourceRoot":"","sources":["../../src/commands/balance.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAE7D,yDAAyD;AACzD,SAAS,SAAS,CAAC,GAAW;IAC5B,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,CAAC,CAAA;AAC9B,CAAC;AAED,gDAAgD;AAChD,SAAS,UAAU,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,KAAK,CAAC,GAAG,CAAC,kBAAkB,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAC5D,CAAA;oBACD,IAAI,MAAM,CAAC,SAAS,KAAK,MAAM,CAAC,OAAO,EAAE,CAAC;wBACxC,OAAO,CAAC,GAAG,CAAC,kBAAkB,MAAM,CAAC,SAAS,MAAM,CAAC,CAAA;wBACrD,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,GAAG,CAAC,kBAAkB,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,CAC9D,CAAA;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,MAAM,MAAM,GAAG,GAAG,EAAE,QAAQ,EAAE,MAAM,CAAA;YACpC,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;gBACnB,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,MAAM,CACV,+DAA+D,CAChE,CACF,CAAA;gBACD,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,GAAG,CACP,wEAAwE,CACzE,CACF,CAAA;YACH,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,GAAG,CAAC,8BAA8B,GAAG,CAAC,OAAO,IAAI,GAAG,EAAE,CAAC,CAC9D,CAAA;gBACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;YACjB,CAAC;QACH,CAAC;QAED,OAAO,CAAC,GAAG,EAAE,CAAA;IACf,CAAC,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI command: check <url>
|
|
3
|
+
*
|
|
4
|
+
* Check if a URL accepts x402-bch v2.2 BCH payments without making the actual request.
|
|
5
|
+
* Useful for AI to determine if payment will be required before committing.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* paytaca check https://api.example.com
|
|
9
|
+
* paytaca check https://api.example.com --json
|
|
10
|
+
* paytaca check https://api.example.com --method POST --body '{"query":"hi"}'
|
|
11
|
+
*/
|
|
12
|
+
import { Command } from 'commander';
|
|
13
|
+
export declare function registerCheckCommand(program: Command): void;
|
|
14
|
+
//# sourceMappingURL=check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AA8BnC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAyF3D"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI command: check <url>
|
|
3
|
+
*
|
|
4
|
+
* Check if a URL accepts x402-bch v2.2 BCH payments without making the actual request.
|
|
5
|
+
* Useful for AI to determine if payment will be required before committing.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* paytaca check https://api.example.com
|
|
9
|
+
* paytaca check https://api.example.com --json
|
|
10
|
+
* paytaca check https://api.example.com --method POST --body '{"query":"hi"}'
|
|
11
|
+
*/
|
|
12
|
+
import chalk from 'chalk';
|
|
13
|
+
import { loadWallet, loadMnemonic } from '../wallet/index.js';
|
|
14
|
+
import { LibauthHDWallet } from '../wallet/keys.js';
|
|
15
|
+
import { parsePaymentRequiredJson, selectBchPaymentRequirements } from '../utils/x402.js';
|
|
16
|
+
import { BCH_DERIVATION_PATH } from '../utils/network.js';
|
|
17
|
+
export function registerCheckCommand(program) {
|
|
18
|
+
program
|
|
19
|
+
.command('check')
|
|
20
|
+
.description('Check if a URL accepts x402-bch v2.2 BCH payments')
|
|
21
|
+
.argument('<url>', 'URL to check')
|
|
22
|
+
.option('-X, --method <method>', 'HTTP method to test (default: GET)', 'GET')
|
|
23
|
+
.option('-H, --header <header>', 'Add header to request (repeatable)')
|
|
24
|
+
.option('-d, --body <body>', 'Request body for POST/PUT requests')
|
|
25
|
+
.option('--chipnet', 'Use chipnet (testnet) instead of mainnet')
|
|
26
|
+
.option('--json', 'Output results as JSON')
|
|
27
|
+
.action(async (url, opts) => {
|
|
28
|
+
const isChipnet = Boolean(opts.chipnet);
|
|
29
|
+
const isJson = Boolean(opts.json);
|
|
30
|
+
const network = isChipnet ? 'chipnet' : 'mainnet';
|
|
31
|
+
const data = loadMnemonic();
|
|
32
|
+
if (!data) {
|
|
33
|
+
const err = 'No wallet found. Run `paytaca wallet create` or `paytaca wallet import` first.';
|
|
34
|
+
if (isJson) {
|
|
35
|
+
console.log(JSON.stringify({ url, acceptsX402: false, acceptsBch: false, paymentRequired: false, error: err }));
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
console.log(chalk.red(`\n${err}\n`));
|
|
39
|
+
}
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
const wallet = loadWallet();
|
|
43
|
+
const bchWallet = wallet.forNetwork(isChipnet);
|
|
44
|
+
const hdWallet = new LibauthHDWallet(data.mnemonic, BCH_DERIVATION_PATH, isChipnet ? 'chipnet' : 'mainnet');
|
|
45
|
+
const headers = {};
|
|
46
|
+
if (opts.header) {
|
|
47
|
+
for (const h of opts.header) {
|
|
48
|
+
const idx = h.indexOf(':');
|
|
49
|
+
if (idx === -1) {
|
|
50
|
+
const err = `Invalid header format: ${h}. Expected "Key: Value"`;
|
|
51
|
+
if (isJson) {
|
|
52
|
+
console.log(JSON.stringify({ url, acceptsX402: false, acceptsBch: false, error: err }));
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
console.log(chalk.red(`\n Error: ${err}\n`));
|
|
56
|
+
}
|
|
57
|
+
process.exit(1);
|
|
58
|
+
}
|
|
59
|
+
const key = h.substring(0, idx).trim();
|
|
60
|
+
const value = h.substring(idx + 1).trim();
|
|
61
|
+
headers[key] = value;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const method = opts.method?.toUpperCase() || 'GET';
|
|
65
|
+
const body = opts.body;
|
|
66
|
+
if (!isJson) {
|
|
67
|
+
console.log(`\n ${chalk.bold('CHECK')} ${url}`);
|
|
68
|
+
console.log(chalk.dim(` Network: ${chalk.cyan(network)}`));
|
|
69
|
+
console.log(chalk.dim(` Method: ${method}`));
|
|
70
|
+
console.log();
|
|
71
|
+
}
|
|
72
|
+
try {
|
|
73
|
+
const result = await checkUrl(url, method, headers, body, bchWallet, isChipnet);
|
|
74
|
+
if (isJson) {
|
|
75
|
+
console.log(JSON.stringify(result, null, 2));
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
printCheckResult(result);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
catch (err) {
|
|
82
|
+
const errorResult = {
|
|
83
|
+
url,
|
|
84
|
+
acceptsX402: false,
|
|
85
|
+
acceptsBch: false,
|
|
86
|
+
paymentRequired: false,
|
|
87
|
+
error: err.message || String(err),
|
|
88
|
+
};
|
|
89
|
+
if (isJson) {
|
|
90
|
+
console.log(JSON.stringify(errorResult, null, 2));
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
console.log(chalk.red(`\n Error: ${err.message || err}\n`));
|
|
94
|
+
}
|
|
95
|
+
process.exit(1);
|
|
96
|
+
}
|
|
97
|
+
if (!isJson)
|
|
98
|
+
console.log();
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
async function checkUrl(url, method, headers, body, bchWallet, isChipnet) {
|
|
102
|
+
const result = {
|
|
103
|
+
url,
|
|
104
|
+
acceptsX402: false,
|
|
105
|
+
acceptsBch: false,
|
|
106
|
+
paymentRequired: false,
|
|
107
|
+
};
|
|
108
|
+
const response = await fetch(url, {
|
|
109
|
+
method,
|
|
110
|
+
headers,
|
|
111
|
+
body: ['POST', 'PUT', 'PATCH'].includes(method) ? body : undefined,
|
|
112
|
+
});
|
|
113
|
+
result.paymentRequired = response.status === 402;
|
|
114
|
+
if (response.status === 402) {
|
|
115
|
+
try {
|
|
116
|
+
const responseBody = await response.json();
|
|
117
|
+
const paymentRequired = parsePaymentRequiredJson(responseBody);
|
|
118
|
+
if (paymentRequired) {
|
|
119
|
+
result.acceptsX402 = paymentRequired.x402Version === 2;
|
|
120
|
+
result.resourceUrl = paymentRequired.resource?.url;
|
|
121
|
+
const bchReqs = selectBchPaymentRequirements(paymentRequired, isChipnet ? 'chipnet' : 'mainnet');
|
|
122
|
+
if (bchReqs) {
|
|
123
|
+
result.acceptsBch = true;
|
|
124
|
+
result.paymentUrl = bchReqs.payTo;
|
|
125
|
+
result.estimatedCostSats = bchReqs.amount;
|
|
126
|
+
result.costInBch = (Number(bchReqs.amount) / 1e8).toFixed(8);
|
|
127
|
+
result.maxTimeoutSeconds = bchReqs.maxTimeoutSeconds;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
catch (e) {
|
|
132
|
+
result.error = 'Failed to parse 402 response body';
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return result;
|
|
136
|
+
}
|
|
137
|
+
function printCheckResult(result) {
|
|
138
|
+
if (result.paymentRequired) {
|
|
139
|
+
console.log(chalk.yellow(' Payment Required'));
|
|
140
|
+
if (result.acceptsX402) {
|
|
141
|
+
console.log(chalk.green(' ✓ Accepts x402-bch v2.2 protocol'));
|
|
142
|
+
if (result.acceptsBch) {
|
|
143
|
+
console.log(chalk.green(` ✓ Accepts BCH payment`));
|
|
144
|
+
console.log(chalk.dim(` Amount: ${result.estimatedCostSats} sats (${result.costInBch} BCH)`));
|
|
145
|
+
console.log(chalk.dim(` Payment URL: ${result.paymentUrl}`));
|
|
146
|
+
console.log(chalk.dim(` Timeout: ${result.maxTimeoutSeconds}s`));
|
|
147
|
+
console.log(chalk.dim(` Resource: ${result.resourceUrl}`));
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
console.log(chalk.red(' ✗ Does not accept BCH'));
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
console.log(chalk.red(' ✗ Unknown payment protocol (not x402-bch v2.2)'));
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
console.log(chalk.green(' ✓ No payment required'));
|
|
159
|
+
console.log(chalk.dim(` Status: ${result.url} is free to access`));
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.js","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAEnD,OAAO,EAAE,wBAAwB,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAA;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAwBzD,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,OAAO;SACJ,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,mDAAmD,CAAC;SAChE,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;SACjC,MAAM,CAAC,uBAAuB,EAAE,oCAAoC,EAAE,KAAK,CAAC;SAC5E,MAAM,CAAC,uBAAuB,EAAE,oCAAoC,CAAC;SACrE,MAAM,CAAC,mBAAmB,EAAE,oCAAoC,CAAC;SACjE,MAAM,CAAC,WAAW,EAAE,0CAA0C,CAAC;SAC/D,MAAM,CAAC,QAAQ,EAAE,wBAAwB,CAAC;SAC1C,MAAM,CAAC,KAAK,EAAE,GAAW,EAAE,IAAkB,EAAE,EAAE;QAChD,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QACvC,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACjC,MAAM,OAAO,GA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CAAC,GAAG,oBAAoB,CAAC,CAAC,CAAA;IACxE,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI command: claude
|
|
3
|
+
*
|
|
4
|
+
* Set up paytaca x402 payment handling for Claude Code AI assistant.
|
|
5
|
+
* Installs the paytaca skill so Claude Code knows how to handle 402 responses.
|
|
6
|
+
*/
|
|
7
|
+
import { Command } from 'commander';
|
|
8
|
+
export declare function registerClaudeCommand(program: Command): void;
|
|
9
|
+
//# sourceMappingURL=claude.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../../src/commands/claude.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAKnC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAW5D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI command: claude
|
|
3
|
+
*
|
|
4
|
+
* Set up paytaca x402 payment handling for Claude Code AI assistant.
|
|
5
|
+
* Installs the paytaca skill so Claude Code knows how to handle 402 responses.
|
|
6
|
+
*/
|
|
7
|
+
import { SUPPORTED_ASSISTANTS, handleSkillAction } from '../utils/skill.js';
|
|
8
|
+
export function registerClaudeCommand(program) {
|
|
9
|
+
const assistant = SUPPORTED_ASSISTANTS.find(a => a.name === 'Claude Code');
|
|
10
|
+
if (!assistant)
|
|
11
|
+
return;
|
|
12
|
+
program
|
|
13
|
+
.command('claude')
|
|
14
|
+
.description('Set up paytaca x402 payments for Claude Code AI assistant')
|
|
15
|
+
.argument('[action]', 'Action: install, uninstall, status', 'status')
|
|
16
|
+
.action(async (action) => {
|
|
17
|
+
handleSkillAction(assistant, action);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=claude.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude.js","sourceRoot":"","sources":["../../src/commands/claude.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAE3E,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IACpD,MAAM,SAAS,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,aAAa,CAAC,CAAA;IAC1E,IAAI,CAAC,SAAS;QAAE,OAAM;IAEtB,OAAO;SACJ,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,2DAA2D,CAAC;SACxE,QAAQ,CAAC,UAAU,EAAE,oCAAoC,EAAE,QAAQ,CAAC;SACpE,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,EAAE;QAC/B,iBAAiB,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA;IACtC,CAAC,CAAC,CAAA;AACN,CAAC"}
|