@emblemvault/agentwallet 3.0.1 → 3.0.3

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 (2) hide show
  1. package/emblemai.js +48 -7
  2. package/package.json +1 -1
package/emblemai.js CHANGED
@@ -10,6 +10,11 @@
10
10
  * Agent mode (single message for AI agents):
11
11
  * emblemai --agent -p "password" -m "What are my balances?"
12
12
  *
13
+ * PAYG billing:
14
+ * emblemai --payg on SOL # Enable with SOL as payment token
15
+ * emblemai --payg on # Enable (keeps current token)
16
+ * emblemai --payg off # Disable
17
+ *
13
18
  * Reset conversation:
14
19
  * emblemai --reset
15
20
  */
@@ -107,6 +112,15 @@ const isReset = hasFlag(['--reset']);
107
112
  const initialDebug = hasFlag(['--debug']);
108
113
  const initialStream = hasFlag(['--stream']);
109
114
  const initialLog = hasFlag(['--log']);
115
+ // --payg on [TOKEN] | --payg off
116
+ const paygArg = (() => {
117
+ const idx = args.indexOf('--payg');
118
+ if (idx === -1) return null;
119
+ const action = args[idx + 1];
120
+ if (action === 'on') return { action: 'on', token: args[idx + 2] && !args[idx + 2].startsWith('-') ? args[idx + 2].toUpperCase() : null };
121
+ if (action === 'off') return { action: 'off' };
122
+ return null;
123
+ })();
110
124
  const passwordArg = getArg(['--password', '-p']);
111
125
  const messageArg = getArg(['--message', '-m']);
112
126
  const hustleUrlArg = getArg(['--hustle-url']);
@@ -353,6 +367,28 @@ async function main() {
353
367
 
354
368
  const client = new HustleIncognitoClient(hustleClientConfig);
355
369
 
370
+ // ── Handle --payg (configure, then continue or exit) ───────────────────
371
+ if (paygArg) {
372
+ try {
373
+ const config = { enabled: paygArg.action === 'on' };
374
+ if (paygArg.token) config.payment_token = paygArg.token;
375
+ const result = await client.configurePayg(config);
376
+ if (result.success) {
377
+ if (paygArg.action === 'on') {
378
+ console.log(fmt.success(`PAYG billing enabled${paygArg.token ? ` (token: ${paygArg.token})` : ''}.`));
379
+ } else {
380
+ console.log(fmt.success('PAYG billing disabled.'));
381
+ }
382
+ } else {
383
+ console.error(fmt.error(`Failed to ${paygArg.action === 'on' ? 'enable' : 'disable'} PAYG.`));
384
+ process.exit(1);
385
+ }
386
+ } catch (err) {
387
+ console.error(fmt.error(`PAYG error: ${err.message}`));
388
+ process.exit(1);
389
+ }
390
+ }
391
+
356
392
  // ── Settings ──────────────────────────────────────────────────────────
357
393
  const settings = {
358
394
  debug: initialDebug,
@@ -417,14 +453,19 @@ async function main() {
417
453
  await showSplash();
418
454
 
419
455
  // Show banner after splash
456
+ const W = 59; // inner width between ║ borders
457
+ const pad = (s, visible) => s + ' '.repeat(Math.max(0, W - visible));
420
458
  console.log('');
421
- console.log(fmt.brand('╔═══════════════════════════════════════════════════════════╗'));
422
- console.log(fmt.brand('║') + ' ' + fmt.brand('║'));
423
- console.log(fmt.brand('║') + ` ${chalk.bold.white('⚡ EMBLEM AI')} ${chalk.dim(`v${PKG_VERSION} — Agent Command & Control`)} ` + fmt.brand('║'));
424
- console.log(fmt.brand('║') + ' ' + fmt.brand('║'));
425
- console.log(fmt.brand('║') + ` ${chalk.dim('Powered by Hustle Incognito')} ` + fmt.brand('║'));
426
- console.log(fmt.brand('║') + ' ' + fmt.brand('║'));
427
- console.log(fmt.brand('╚═══════════════════════════════════════════════════════════╝'));
459
+ console.log(fmt.brand('' + '═'.repeat(W) + '╗'));
460
+ console.log(fmt.brand('║') + ' '.repeat(W) + fmt.brand('║'));
461
+ const title = ` ⚡ EMBLEM AI v${PKG_VERSION} — Agent Command & Control`;
462
+ const titleLen = title.length + 1; // ⚡ renders as 2 columns
463
+ console.log(fmt.brand('║') + pad(` ${chalk.bold.white(' EMBLEM AI')} ${chalk.dim(`v${PKG_VERSION} — Agent Command & Control`)}`, titleLen) + fmt.brand('║'));
464
+ console.log(fmt.brand('║') + ' '.repeat(W) + fmt.brand('║'));
465
+ const sub = ' Powered by Hustle Incognito';
466
+ console.log(fmt.brand('║') + pad(` ${chalk.dim('Powered by Hustle Incognito')}`, sub.length) + fmt.brand('║'));
467
+ console.log(fmt.brand('║') + ' '.repeat(W) + fmt.brand('║'));
468
+ console.log(fmt.brand('╚' + '═'.repeat(W) + '╝'));
428
469
  console.log('');
429
470
 
430
471
  // Load plugins
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emblemvault/agentwallet",
3
- "version": "3.0.1",
3
+ "version": "3.0.3",
4
4
  "description": "CLI for EmblemVault Hustle AI - autonomous crypto wallet management with browser auth, streaming, and plugins",
5
5
  "main": "emblemai.js",
6
6
  "type": "module",