@palmyr/cli 1.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.
Files changed (47) hide show
  1. package/README.md +731 -0
  2. package/dist/admin-auth.d.ts +1 -0
  3. package/dist/admin-auth.js +52 -0
  4. package/dist/admin-auth.js.map +1 -0
  5. package/dist/app.d.ts +182 -0
  6. package/dist/app.js +218 -0
  7. package/dist/app.js.map +1 -0
  8. package/dist/cli.d.ts +2 -0
  9. package/dist/cli.js +3495 -0
  10. package/dist/cli.js.map +1 -0
  11. package/dist/compute-ssh.d.ts +246 -0
  12. package/dist/compute-ssh.js +577 -0
  13. package/dist/compute-ssh.js.map +1 -0
  14. package/dist/config.d.ts +46 -0
  15. package/dist/config.js +183 -0
  16. package/dist/config.js.map +1 -0
  17. package/dist/credential-store.d.ts +4 -0
  18. package/dist/credential-store.js +180 -0
  19. package/dist/credential-store.js.map +1 -0
  20. package/dist/mascot-data.d.ts +1 -0
  21. package/dist/mascot-data.js +14 -0
  22. package/dist/mascot-data.js.map +1 -0
  23. package/dist/pay.d.ts +60 -0
  24. package/dist/pay.js +483 -0
  25. package/dist/pay.js.map +1 -0
  26. package/dist/sdk.d.ts +259 -0
  27. package/dist/sdk.js +944 -0
  28. package/dist/sdk.js.map +1 -0
  29. package/dist/social-queue.d.ts +125 -0
  30. package/dist/social-queue.js +340 -0
  31. package/dist/social-queue.js.map +1 -0
  32. package/dist/social-vault.d.ts +118 -0
  33. package/dist/social-vault.js +268 -0
  34. package/dist/social-vault.js.map +1 -0
  35. package/dist/social-worker.d.ts +43 -0
  36. package/dist/social-worker.js +155 -0
  37. package/dist/social-worker.js.map +1 -0
  38. package/dist/totp.d.ts +2 -0
  39. package/dist/totp.js +46 -0
  40. package/dist/totp.js.map +1 -0
  41. package/dist/ui.d.ts +77 -0
  42. package/dist/ui.js +441 -0
  43. package/dist/ui.js.map +1 -0
  44. package/dist/vault.d.ts +65 -0
  45. package/dist/vault.js +455 -0
  46. package/dist/vault.js.map +1 -0
  47. package/package.json +75 -0
package/dist/vault.js ADDED
@@ -0,0 +1,455 @@
1
+ /**
2
+ * CLI-side reader for the Palmyr wallet vault.
3
+ *
4
+ * Loads encrypted wallet files from ~/.palmyr/wallet/ and decrypts them
5
+ * using the session secret from the OS credential store. Falls back to
6
+ * passphrase-based decryption for legacy wallets.
7
+ */
8
+ import { randomBytes, createCipheriv, createDecipheriv, scryptSync } from 'crypto';
9
+ import { existsSync, readFileSync, readdirSync, writeFileSync, mkdirSync, renameSync, openSync, closeSync, statSync, unlinkSync } from 'fs';
10
+ import { join } from 'path';
11
+ import { homedir } from 'os';
12
+ import { createRequire } from 'module';
13
+ import * as bip39 from 'bip39';
14
+ import { derivePath } from 'ed25519-hd-key';
15
+ import { Keypair } from '@solana/web3.js';
16
+ import { retrieveSecret } from './credential-store.js';
17
+ const require = createRequire(import.meta.url);
18
+ function getVaultDir() {
19
+ return process.env.PALMYR_WALLET_PATH || join(homedir(), '.palmyr', 'wallet');
20
+ }
21
+ function decryptWithRawKey(blob, keyHex) {
22
+ const key = Buffer.from(keyHex, 'hex');
23
+ const decipher = createDecipheriv('aes-256-gcm', key, Buffer.from(blob.iv, 'hex'));
24
+ decipher.setAuthTag(Buffer.from(blob.tag, 'hex'));
25
+ let decrypted = decipher.update(blob.ciphertext, 'hex', 'utf8');
26
+ decrypted += decipher.final('utf8');
27
+ return decrypted;
28
+ }
29
+ function decryptWithPassphrase(blob, passphrase) {
30
+ if (!passphrase)
31
+ throw new Error('Passphrase is required to decrypt wallet');
32
+ const key = scryptSync(passphrase, Buffer.from(blob.salt, 'hex'), 32);
33
+ const decipher = createDecipheriv('aes-256-gcm', key, Buffer.from(blob.iv, 'hex'));
34
+ decipher.setAuthTag(Buffer.from(blob.tag, 'hex'));
35
+ let decrypted = decipher.update(blob.ciphertext, 'hex', 'utf8');
36
+ decrypted += decipher.final('utf8');
37
+ return decrypted;
38
+ }
39
+ function loadWalletFile(nameOrId) {
40
+ const dir = join(getVaultDir(), 'wallets');
41
+ if (!existsSync(dir))
42
+ throw new Error(`Vault directory not found: ${dir}`);
43
+ for (const f of readdirSync(dir).filter(x => x.endsWith('.json'))) {
44
+ const data = JSON.parse(readFileSync(join(dir, f), 'utf8'));
45
+ if (data.id === nameOrId || data.name === nameOrId) {
46
+ return data;
47
+ }
48
+ }
49
+ throw new Error(`Wallet "${nameOrId}" not found in vault at ${dir}`);
50
+ }
51
+ /**
52
+ * Bidirectional integrity check: the mnemonic must derive exactly the accounts
53
+ * stored in the file. Catches tampered addresses AND deleted/injected accounts.
54
+ */
55
+ function verifyIntegrity(file, mnemonic) {
56
+ const derived = deriveAllAccounts(mnemonic);
57
+ // Every stored account must be derivable at the same address
58
+ for (const stored of file.accounts) {
59
+ const match = derived.find(d => d.chainId === stored.chainId);
60
+ if (!match) {
61
+ throw new Error(`SECURITY: wallet file integrity check failed. ` +
62
+ `Chain ${stored.chainId} present in file but not derivable from mnemonic. ` +
63
+ `The wallet file may have been tampered with. Refusing to sign.`);
64
+ }
65
+ if (match.address !== stored.address) {
66
+ throw new Error(`SECURITY: wallet file integrity check failed. ` +
67
+ `Stored address for ${stored.chainId} does not match derived. ` +
68
+ `Expected ${match.address}, found ${stored.address}. ` +
69
+ `The wallet file may have been tampered with. Refusing to sign.`);
70
+ }
71
+ }
72
+ // Note: we deliberately do NOT reverse-check that every derivable chain is
73
+ // present in the file. Derivation is deterministic and public, so an attacker
74
+ // cannot gain anything by removing a chain from the file. Enforcing reverse
75
+ // equality only breaks wallets created before new chains were added to the
76
+ // derivation set, which has real operational cost with zero security upside.
77
+ }
78
+ function resolveMnemonic(file, passphrase) {
79
+ let mnemonic;
80
+ // Try session secret from OS credential store (new format)
81
+ if (file.session_crypto) {
82
+ const sessionSecret = retrieveSecret(file.id);
83
+ if (sessionSecret) {
84
+ mnemonic = decryptWithRawKey(file.session_crypto, sessionSecret);
85
+ verifyIntegrity(file, mnemonic);
86
+ return mnemonic;
87
+ }
88
+ }
89
+ // Fall back to passphrase (legacy v2 format)
90
+ if (file.owner_crypto && passphrase) {
91
+ mnemonic = decryptWithPassphrase(file.owner_crypto, passphrase);
92
+ verifyIntegrity(file, mnemonic);
93
+ return mnemonic;
94
+ }
95
+ if (file.session_crypto) {
96
+ throw new Error('No session secret found in OS credential store. Was this wallet created on this machine?');
97
+ }
98
+ throw new Error('No passphrase provided and no session secret available');
99
+ }
100
+ function keypairFromMnemonic(mnemonic) {
101
+ const seed = bip39.mnemonicToSeedSync(mnemonic);
102
+ const derived = derivePath("m/44'/501'/0'/0'", seed.toString('hex'));
103
+ return Keypair.fromSeed(derived.key);
104
+ }
105
+ /**
106
+ * Derive the Base/EVM address for a wallet whose `accounts` array doesn't
107
+ * include an `eip155:` entry yet (legacy wallets predate EVM-account storage).
108
+ * Reuses the OS credential-store session secret — never prompts.
109
+ *
110
+ * Returns null if derivation isn't possible (raw private-key wallet, missing
111
+ * session secret, or any decrypt failure). Caller treats that as "no Base
112
+ * address to show" rather than an error.
113
+ */
114
+ function deriveEvmFromVaultFile(data) {
115
+ if (data.key_type !== 'mnemonic')
116
+ return null;
117
+ try {
118
+ const mnemonic = resolveMnemonic(data);
119
+ const { ethers } = require('ethers');
120
+ const hd = ethers.HDNodeWallet.fromPhrase(mnemonic, undefined, "m/44'/60'/0'/0/0");
121
+ return hd.address;
122
+ }
123
+ catch {
124
+ return null;
125
+ }
126
+ }
127
+ /**
128
+ * Backfill an `eip155:1` account entry into a legacy wallet's JSON file so
129
+ * subsequent reads don't have to derive on the fly. Locked + atomic write so
130
+ * concurrent CLI invocations don't corrupt the file.
131
+ *
132
+ * Failures here are non-fatal — the caller still has the derived address in
133
+ * memory; this is purely a cache-on-disk optimization.
134
+ */
135
+ function persistEvmAccount(filePath, address) {
136
+ const release = acquireLock(filePath);
137
+ try {
138
+ // Re-read inside the lock so we merge with whatever the file currently
139
+ // holds — another writer (e.g. concurrent `wallet info`) may have already
140
+ // backfilled and we don't want to clobber unrelated changes.
141
+ const fresh = JSON.parse(readFileSync(filePath, 'utf8'));
142
+ if (!Array.isArray(fresh.accounts))
143
+ return;
144
+ if (fresh.accounts.some(a => a.chainId?.startsWith('eip155:')))
145
+ return; // already has one
146
+ fresh.accounts.push({
147
+ chainId: 'eip155:1',
148
+ address,
149
+ derivationPath: "m/44'/60'/0'/0/0",
150
+ });
151
+ atomicWriteFileSync(filePath, JSON.stringify(fresh, null, 2));
152
+ }
153
+ catch {
154
+ // Swallow — backfill is best-effort. The lazy derive still works on next read.
155
+ }
156
+ finally {
157
+ release();
158
+ }
159
+ }
160
+ /**
161
+ * List all wallets in the local vault.
162
+ * Corrupted files are skipped with a warning — one bad file never breaks the whole listing.
163
+ */
164
+ export function listVaultWallets() {
165
+ const dir = join(getVaultDir(), 'wallets');
166
+ if (!existsSync(dir))
167
+ return [];
168
+ const wallets = [];
169
+ for (const f of readdirSync(dir).filter(x => x.endsWith('.json'))) {
170
+ const filePath = join(dir, f);
171
+ try {
172
+ const data = JSON.parse(readFileSync(filePath, 'utf8'));
173
+ if (!data?.id || !Array.isArray(data.accounts)) {
174
+ console.warn(`[vault] skipping ${f}: missing required fields`);
175
+ continue;
176
+ }
177
+ const sol = data.accounts.find(a => a.chainId?.startsWith('solana:'))?.address || null;
178
+ let evm = data.accounts.find(a => a.chainId?.startsWith('eip155:'))?.address || null;
179
+ // Legacy wallets predate EVM-account storage. Fall back to deriving
180
+ // from the same mnemonic, then persist the result so the next read
181
+ // finds it in `accounts` directly.
182
+ if (!evm) {
183
+ const derived = deriveEvmFromVaultFile(data);
184
+ if (derived) {
185
+ evm = derived;
186
+ persistEvmAccount(filePath, derived);
187
+ }
188
+ }
189
+ wallets.push({ id: data.id, name: data.name, mode: data.mode || 'legacy', solanaAddress: sol, evmAddress: evm, createdAt: data.created_at });
190
+ }
191
+ catch (e) {
192
+ console.warn(`[vault] skipping ${f}: ${e.message.split('\n')[0]}`);
193
+ }
194
+ }
195
+ return wallets;
196
+ }
197
+ /**
198
+ * Get a raw Solana Keypair for a vault wallet.
199
+ * Tries OS credential store first, falls back to passphrase.
200
+ */
201
+ export function getVaultSolanaKeypair(walletId, passphrase) {
202
+ const file = loadWalletFile(walletId);
203
+ if (file.key_type !== 'mnemonic')
204
+ throw new Error('Wallet was imported as a raw private key');
205
+ const mnemonic = resolveMnemonic(file, passphrase);
206
+ return keypairFromMnemonic(mnemonic);
207
+ }
208
+ /**
209
+ * Get an ethers Wallet (secp256k1) for a vault wallet.
210
+ * Used for signing EIP-3009 and EVM transactions.
211
+ */
212
+ export function getVaultEvmWallet(walletId, passphrase) {
213
+ const file = loadWalletFile(walletId);
214
+ if (file.key_type !== 'mnemonic')
215
+ throw new Error('Wallet was imported as a raw private key');
216
+ const mnemonic = resolveMnemonic(file, passphrase);
217
+ const { ethers } = require('ethers');
218
+ return ethers.HDNodeWallet.fromPhrase(mnemonic, undefined, "m/44'/60'/0'/0/0");
219
+ }
220
+ /**
221
+ * Sign a message locally — no server needed.
222
+ * Decrypts via session secret from OS credential store, signs with the chain's keypair.
223
+ */
224
+ export function signMessageLocal(walletId, chain, message) {
225
+ const file = loadWalletFile(walletId);
226
+ const mnemonic = resolveMnemonic(file);
227
+ const c = chain.toLowerCase();
228
+ const msgBytes = Buffer.from(message, 'utf8');
229
+ if (c === 'solana' || c.startsWith('solana:')) {
230
+ const kp = keypairFromMnemonic(mnemonic);
231
+ const nacl = require('tweetnacl');
232
+ const sig = nacl.sign.detached(msgBytes, kp.secretKey);
233
+ return { signature: Buffer.from(sig).toString('hex') };
234
+ }
235
+ if (c === 'evm' || c === 'base' || c === 'ethereum' || c.startsWith('eip155:')) {
236
+ const { ethers } = require('ethers');
237
+ const hd = ethers.HDNodeWallet.fromPhrase(mnemonic, undefined, "m/44'/60'/0'/0/0");
238
+ const sig = hd.signMessageSync(message);
239
+ return { signature: sig.replace('0x', '') };
240
+ }
241
+ throw new Error(`Chain "${chain}" not supported for message signing`);
242
+ }
243
+ /** Check if any vault wallets exist locally. */
244
+ export function hasVaultWallets() {
245
+ const dir = join(getVaultDir(), 'wallets');
246
+ if (!existsSync(dir))
247
+ return false;
248
+ return readdirSync(dir).some(f => f.endsWith('.json'));
249
+ }
250
+ const SAFE_NAME_RE = /^[a-zA-Z0-9 _\-\.]{1,128}$/;
251
+ function validateName(name) {
252
+ if (!name || typeof name !== 'string')
253
+ throw new Error('Wallet name is required');
254
+ const trimmed = name.trim();
255
+ if (!SAFE_NAME_RE.test(trimmed)) {
256
+ throw new Error(`Invalid wallet name: must be 1-128 characters, alphanumeric/spaces/hyphens/underscores/dots only. Got: "${trimmed.slice(0, 30)}"`);
257
+ }
258
+ return trimmed;
259
+ }
260
+ function atomicWriteFileSync(filePath, data) {
261
+ const tmpPath = filePath + `.tmp.${process.pid}`;
262
+ writeFileSync(tmpPath, data);
263
+ renameSync(tmpPath, filePath);
264
+ }
265
+ const LOCK_STALE_MS = 30_000;
266
+ const LOCK_RETRY_MS = 50;
267
+ const LOCK_TIMEOUT_MS = 5_000;
268
+ function acquireLock(targetPath) {
269
+ const lockPath = targetPath + '.lock';
270
+ const deadline = Date.now() + LOCK_TIMEOUT_MS;
271
+ while (true) {
272
+ try {
273
+ const fd = openSync(lockPath, 'wx');
274
+ writeFileSync(lockPath, `${process.pid}\n${Date.now()}`);
275
+ closeSync(fd);
276
+ return () => { try {
277
+ unlinkSync(lockPath);
278
+ }
279
+ catch { } };
280
+ }
281
+ catch (err) {
282
+ if (err.code !== 'EEXIST')
283
+ throw err;
284
+ try {
285
+ const stat = statSync(lockPath);
286
+ if (Date.now() - stat.mtimeMs > LOCK_STALE_MS) {
287
+ try {
288
+ unlinkSync(lockPath);
289
+ }
290
+ catch { }
291
+ continue;
292
+ }
293
+ }
294
+ catch {
295
+ continue;
296
+ }
297
+ if (Date.now() >= deadline) {
298
+ throw new Error(`Timed out waiting for lock on ${targetPath}`);
299
+ }
300
+ const waitUntil = Date.now() + LOCK_RETRY_MS;
301
+ while (Date.now() < waitUntil) { /* spin */ }
302
+ }
303
+ }
304
+ }
305
+ function withLock(targetPath, fn) {
306
+ const release = acquireLock(targetPath);
307
+ try {
308
+ return fn();
309
+ }
310
+ finally {
311
+ release();
312
+ }
313
+ }
314
+ function ensureVaultDirs() {
315
+ const base = getVaultDir();
316
+ for (const sub of ['wallets', 'keys', 'policies', 'spends']) {
317
+ const p = join(base, sub);
318
+ if (!existsSync(p))
319
+ mkdirSync(p, { recursive: true });
320
+ }
321
+ }
322
+ function encryptWithRawKey(plaintext, keyHex) {
323
+ const key = Buffer.from(keyHex, 'hex');
324
+ const iv = randomBytes(12);
325
+ const salt = randomBytes(32);
326
+ const cipher = createCipheriv('aes-256-gcm', key, iv);
327
+ let encrypted = cipher.update(plaintext, 'utf8', 'hex');
328
+ encrypted += cipher.final('hex');
329
+ return {
330
+ iv: iv.toString('hex'),
331
+ salt: salt.toString('hex'),
332
+ ciphertext: encrypted,
333
+ tag: cipher.getAuthTag().toString('hex'),
334
+ };
335
+ }
336
+ /**
337
+ * Distinguish "ethers module can't even load" (missing dependency, broken
338
+ * install) from "ethers loaded but threw mid-derivation" (genuinely odd
339
+ * input). The former is an environment problem; the latter is a real
340
+ * derivation failure. Callers — especially the integrity check — must NOT
341
+ * treat them the same: missing-ethers cascading into "wallet tampered" was
342
+ * the false-positive in the user report.
343
+ */
344
+ function loadEthers() {
345
+ try {
346
+ return require('ethers');
347
+ }
348
+ catch (e) {
349
+ return { __loadError: e instanceof Error ? e : new Error(String(e)) };
350
+ }
351
+ }
352
+ function deriveAllAccounts(mnemonic) {
353
+ const accounts = [];
354
+ const seed = bip39.mnemonicToSeedSync(mnemonic);
355
+ try {
356
+ const derived = derivePath("m/44'/501'/0'/0'", seed.toString('hex'));
357
+ const kp = Keypair.fromSeed(derived.key);
358
+ accounts.push({
359
+ chainId: 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp',
360
+ address: kp.publicKey.toBase58(),
361
+ derivationPath: "m/44'/501'/0'/0'",
362
+ });
363
+ }
364
+ catch { }
365
+ // ethers MUST be present (it's a declared dependency). If `require('ethers')`
366
+ // throws, that's an environment problem — surface it loudly rather than
367
+ // silently producing a partial account list. A partial list cascades into
368
+ // verifyIntegrity()'s "Chain eip155:1 present in file but not derivable
369
+ // from mnemonic" error, which gets reported as `SECURITY: wallet file
370
+ // integrity check failed` and makes the user think their wallet was
371
+ // tampered with. (Issue: 2026-05-05 user feedback after upgrade from
372
+ // 0.7.17 → 0.7.20.)
373
+ const ethersMod = loadEthers();
374
+ if (ethersMod.__loadError) {
375
+ throw new Error(`Could not load 'ethers'. Reinstall the CLI: 'npm i -g @palmyr/cli@latest'. ` +
376
+ `Underlying error: ${ethersMod.__loadError.message}`);
377
+ }
378
+ try {
379
+ const hd = ethersMod.ethers.HDNodeWallet.fromPhrase(mnemonic, undefined, "m/44'/60'/0'/0/0");
380
+ accounts.push({
381
+ chainId: 'eip155:1',
382
+ address: hd.address,
383
+ derivationPath: "m/44'/60'/0'/0/0",
384
+ });
385
+ }
386
+ catch (e) {
387
+ // ethers loaded but derivation threw. Truly anomalous — re-raise so the
388
+ // integrity check sees a hard failure rather than a missing-account
389
+ // false-positive.
390
+ throw new Error(`EVM (eip155:1) account derivation failed: ${e?.message || e}`);
391
+ }
392
+ return accounts;
393
+ }
394
+ /**
395
+ * Create a wallet locally — no server needed.
396
+ * The session secret must be stored in the OS credential store by the caller.
397
+ */
398
+ export function createLocalWallet(name, mode = 'unmanaged') {
399
+ const safeName = validateName(name);
400
+ ensureVaultDirs();
401
+ const mnemonic = bip39.generateMnemonic(128);
402
+ const id = randomBytes(16).toString('hex');
403
+ const sessionSecret = randomBytes(32).toString('hex');
404
+ const accounts = deriveAllAccounts(mnemonic);
405
+ const file = {
406
+ id,
407
+ name: safeName,
408
+ mode,
409
+ accounts,
410
+ session_crypto: encryptWithRawKey(mnemonic, sessionSecret),
411
+ key_type: 'mnemonic',
412
+ created_at: new Date().toISOString(),
413
+ };
414
+ const fpath = join(getVaultDir(), 'wallets', `${id}.json`);
415
+ withLock(fpath, () => atomicWriteFileSync(fpath, JSON.stringify(file, null, 2)));
416
+ const sol = accounts.find(a => a.chainId.startsWith('solana:'))?.address || null;
417
+ const evm = accounts.find(a => a.chainId.startsWith('eip155:'))?.address || null;
418
+ return { id, name: safeName, mode, sessionSecret, solanaAddress: sol, evmAddress: evm, accounts, createdAt: file.created_at };
419
+ }
420
+ /**
421
+ * Import a wallet from mnemonic locally — no server needed.
422
+ */
423
+ export function importLocalWallet(name, mnemonic, mode = 'unmanaged') {
424
+ const safeName = validateName(name);
425
+ if (!bip39.validateMnemonic(mnemonic))
426
+ throw new Error('Invalid mnemonic');
427
+ ensureVaultDirs();
428
+ const id = randomBytes(16).toString('hex');
429
+ const sessionSecret = randomBytes(32).toString('hex');
430
+ const accounts = deriveAllAccounts(mnemonic);
431
+ const file = {
432
+ id,
433
+ name: safeName,
434
+ mode,
435
+ accounts,
436
+ session_crypto: encryptWithRawKey(mnemonic, sessionSecret),
437
+ key_type: 'mnemonic',
438
+ created_at: new Date().toISOString(),
439
+ };
440
+ const fpath = join(getVaultDir(), 'wallets', `${id}.json`);
441
+ withLock(fpath, () => atomicWriteFileSync(fpath, JSON.stringify(file, null, 2)));
442
+ const sol = accounts.find(a => a.chainId.startsWith('solana:'))?.address || null;
443
+ const evm = accounts.find(a => a.chainId.startsWith('eip155:'))?.address || null;
444
+ return { id, name: safeName, mode, sessionSecret, solanaAddress: sol, evmAddress: evm, accounts, createdAt: file.created_at };
445
+ }
446
+ /**
447
+ * Export the mnemonic for a wallet. Requires the session secret
448
+ * (from OS credential store). This is the single decryption path —
449
+ * never reimplement decryption elsewhere.
450
+ */
451
+ export function exportMnemonic(walletId) {
452
+ const file = loadWalletFile(walletId);
453
+ return resolveMnemonic(file);
454
+ }
455
+ //# sourceMappingURL=vault.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vault.js","sourceRoot":"","sources":["../vault.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,WAAW,EAAE,cAAc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name": "@palmyr/cli",
3
+ "version": "1.0.0",
4
+ "description": "CLI for Palmyr — everything your AI agent needs. Phone, email, compute, domains, wallets, and more.",
5
+ "type": "module",
6
+ "main": "./dist/sdk.js",
7
+ "types": "./dist/sdk.d.ts",
8
+ "bin": {
9
+ "palmyr": "./dist/cli.js"
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/sdk.js",
14
+ "types": "./dist/sdk.d.ts"
15
+ }
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "README.md"
20
+ ],
21
+ "scripts": {
22
+ "build": "tsc",
23
+ "prepublishOnly": "npm run build"
24
+ },
25
+ "keywords": [
26
+ "ai",
27
+ "agent",
28
+ "palmyr",
29
+ "infrastructure",
30
+ "phone",
31
+ "email",
32
+ "compute",
33
+ "domain",
34
+ "wallet",
35
+ "crypto",
36
+ "x402",
37
+ "solana",
38
+ "base"
39
+ ],
40
+ "author": "Palmyr <hello@palmyr.ai>",
41
+ "license": "MIT",
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "git+https://github.com/0xArtex/Palmyr.git",
45
+ "directory": "cli"
46
+ },
47
+ "homepage": "https://palmyr.ai",
48
+ "engines": {
49
+ "node": ">=18.0.0"
50
+ },
51
+ "devDependencies": {
52
+ "@types/node": "^22.0.0",
53
+ "@types/react": "^17.0.91",
54
+ "typescript": "^5.7"
55
+ },
56
+ "dependencies": {
57
+ "@noble/hashes": "^2.0.1",
58
+ "@solana/spl-token": "^0.4.14",
59
+ "@solana/web3.js": "^1.98.4",
60
+ "bip39": "^3.1.0",
61
+ "dotenv": "^17.4.2",
62
+ "ed25519-hd-key": "^1.3.0",
63
+ "ethers": "^6.13.4",
64
+ "ink": "^3.2.0",
65
+ "ink-select-input": "^4.2.2",
66
+ "ink-spinner": "^4.0.3",
67
+ "ink-text-input": "^4.0.3",
68
+ "react": "^17.0.2",
69
+ "string-width": "^7.2.0"
70
+ },
71
+ "bugs": {
72
+ "url": "https://github.com/0xArtex/Palmyr/issues"
73
+ },
74
+ "funding": "https://palmyr.ai"
75
+ }