@sage-protocol/cli 0.4.2 → 0.4.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.
@@ -346,7 +346,8 @@ function register(program) {
346
346
  a.publishing?.status === 'modified' ? 'šŸ“' :
347
347
  a.publishing?.status === 'new' ? '✨' : 'ā“';
348
348
 
349
- console.log(` ${statusIcon} ${syncStatus} ${a.key} ${a.targets.length ? `(targets: ${a.targets.join(',')})` : ''}`);
349
+ const toolsInfo = a.meta?.tools?.length ? ` (tools: ${a.meta.tools.join(',')})` : '';
350
+ console.log(` ${statusIcon} ${syncStatus} ${a.key} ${a.targets.length ? `(targets: ${a.targets.join(',')})` : ''}${toolsInfo}`);
350
351
  });
351
352
  });
352
353
  console.log('\nLegend: šŸ“” Publishable, šŸ”’ Local-only | āœ… Synced, šŸ“ Modified, ✨ New');
@@ -14,7 +14,9 @@ const colors = {
14
14
  green: (text) => `\x1b[32m${text}\x1b[0m`,
15
15
  yellow: (text) => `\x1b[33m${text}\x1b[0m`,
16
16
  blue: (text) => `\x1b[34m${text}\x1b[0m`,
17
- cyan: (text) => `\x1b[36m${text}\x1b[0m`
17
+ cyan: (text) => `\x1b[36m${text}\x1b[0m`,
18
+ dim: (text) => `\x1b[2m${text}\x1b[0m`,
19
+ white: (text) => `\x1b[37m${text}\x1b[0m`
18
20
  };
19
21
 
20
22
  function register(program) {
@@ -376,22 +378,39 @@ const Web3AuthWalletManager = require('../web3auth-wallet-manager');
376
378
  new Command('fund')
377
379
  .description('Get wallet funding instructions')
378
380
  .action(async () => {
381
+ console.log(colors.blue('šŸ’° Wallet Funding Instructions (Base Sepolia Testnet):'));
382
+ console.log('');
383
+ console.log(colors.yellow('šŸ”— Get testnet ETH from:'));
384
+ console.log(colors.cyan(' https://www.coinbase.com/faucets/base-ethereum-sepolia-faucet'));
385
+ console.log('');
386
+
387
+ // Try to show wallet address if already configured (non-interactive)
388
+ let address = null;
379
389
  try {
380
- const walletManager = new WalletManager();
381
- await walletManager.connect();
382
- if (walletManager.wallet && walletManager.wallet.fundWallet) {
383
- await walletManager.wallet.fundWallet();
384
- } else {
385
- console.log(colors.blue('šŸ’° Wallet Funding Instructions:'));
386
- console.log(colors.cyan('šŸ“§ Your wallet address:', walletManager.getAccount()));
387
- console.log(colors.yellow('šŸ”— Get testnet ETH from: https://www.coinbase.com/faucets/base-ethereum-sepolia-faucet'));
388
- console.log(colors.yellow('šŸ“ Send ETH to your address above'));
389
- console.log(colors.green('āœ… Check balance with: sage wallet balance'));
390
- }
391
- } catch (error) {
392
- console.error('āŒ Failed to get funding instructions:', error.message);
393
- process.exit(1);
390
+ const cast = new CastWalletManager();
391
+ const saved = cast.loadCastWallet();
392
+ address = saved?.address || null;
393
+ } catch (_) {}
394
+
395
+ // Fallback to profile wallet address
396
+ if (!address) {
397
+ try {
398
+ const prof = config.readProfiles();
399
+ const ap = prof.activeProfile || 'default';
400
+ address = prof.profiles?.[ap]?.wallet || null;
401
+ } catch (_) {}
402
+ }
403
+
404
+ if (address) {
405
+ console.log(colors.cyan('šŸ“§ Your wallet address:'));
406
+ console.log(colors.white(` ${address}`));
407
+ console.log('');
408
+ console.log(colors.yellow('šŸ“ Send ETH to your address above'));
409
+ } else {
410
+ console.log(colors.dim('šŸ“§ Connect a wallet to see your address: sage wallet connect'));
394
411
  }
412
+ console.log('');
413
+ console.log(colors.green('āœ… Check balance with: sage wallet balance'));
395
414
  })
396
415
  )
397
416
  .addCommand(
@@ -3,6 +3,7 @@ const path = require('path');
3
3
 
4
4
  const DEFAULT_RPC_URL = 'https://base-sepolia.publicnode.com';
5
5
  const DEFAULT_CHAIN_ID = 84532;
6
+ const DEFAULT_SUBGRAPH_URL = 'https://api.goldsky.com/api/public/project_cmhxp0fppsbdd01q56xp2gqw9/subgraphs/sxxx-protocol/1.0.2/gn';
6
7
 
7
8
  const ADDRESS_ALIAS_GROUPS = [
8
9
  ['GOV', 'GOVERNOR_ADDRESS'],
@@ -482,6 +483,18 @@ function createLocalConfig() {
482
483
  return DEFAULT_CHAIN_ID;
483
484
  },
484
485
 
486
+ resolveSubgraphUrl(options = {}) {
487
+ const profileVal = this.resolveProfileValue(['subgraphUrl'], null, options);
488
+ if (profileVal) return profileVal;
489
+ return (
490
+ process.env.SUBGRAPH_URL ||
491
+ process.env.SAGE_SUBGRAPH_URL ||
492
+ process.env.NEXT_PUBLIC_GRAPH_ENDPOINT ||
493
+ process.env.NEXT_PUBLIC_SUBGRAPH_URL ||
494
+ DEFAULT_SUBGRAPH_URL
495
+ );
496
+ },
497
+
485
498
  resolveAddress(key, defaultValue = null, options = {}) {
486
499
  const keys = collectAliasKeys(key);
487
500
  for (const candidate of keys) {
@@ -897,8 +897,12 @@ Note: This tool does NOT sign transactions. It prepares everything so you can ex
897
897
  'function getLibraryRegistry(string) view returns (address)'
898
898
  ];
899
899
 
900
- // Prefer subgraph endpoint from several env keys (works with app config)
901
- this.subgraphUrl = process.env.SUBGRAPH_URL || process.env.NEXT_PUBLIC_GRAPH_ENDPOINT || process.env.NEXT_PUBLIC_SUBGRAPH_URL || '';
900
+ // Prefer subgraph endpoint from config (includes default Goldsky endpoint)
901
+ const config = require('./config');
902
+ this.subgraphUrl = config.resolveSubgraphUrl ? config.resolveSubgraphUrl() : (
903
+ process.env.SUBGRAPH_URL || process.env.NEXT_PUBLIC_GRAPH_ENDPOINT || process.env.NEXT_PUBLIC_SUBGRAPH_URL ||
904
+ 'https://api.goldsky.com/api/public/project_cmhxp0fppsbdd01q56xp2gqw9/subgraphs/sxxx-protocol/1.0.2/gn'
905
+ );
902
906
 
903
907
  // Local library helper for unified search
904
908
  this.libraryManager = new LibraryManager();
@@ -1398,6 +1402,7 @@ Note: This tool does NOT sign transactions. It prepares everything so you can ex
1398
1402
  publishable: a.publishable,
1399
1403
  publishing: a.publishing,
1400
1404
  targets: a.targets,
1405
+ tools: a.meta?.tools || [],
1401
1406
  filePath: a.filePath,
1402
1407
  }));
1403
1408
  }
@@ -1482,12 +1487,14 @@ Note: This tool does NOT sign transactions. It prepares everything so you can ex
1482
1487
  publishable: artifact.publishable,
1483
1488
  publishing: artifact.publishing,
1484
1489
  targets: artifact.targets,
1490
+ tools: artifact.meta?.tools || [],
1485
1491
  filePath: artifact.filePath,
1486
1492
  };
1487
1493
 
1488
1494
  const kindBadge = prompt.kind !== 'prompt' ? ` [${prompt.kind}]` : '';
1489
1495
  const publishBadge = prompt.publishable ? '' : ' (local only)';
1490
- const text = `**${prompt.name}**${kindBadge}${publishBadge}\n\nšŸ”‘ Key: ${prompt.key}\nšŸ“‚ Source: Workspace\nšŸ“„ ${prompt.description || 'No description'}\nšŸ·ļø Tags: ${prompt.tags?.join(', ') || 'None'}\nšŸ“Œ Kind: ${prompt.kind}\nšŸ“¤ Publishable: ${prompt.publishable}\nšŸ“Š Status: ${prompt.publishing?.status || 'unknown'}\n\n**Content:**\n\`\`\`\n${prompt.content || '(No content)'}\n\`\`\``;
1496
+ const toolsLine = prompt.tools?.length ? `\nšŸ› ļø Tools: ${prompt.tools.join(', ')}` : '';
1497
+ const text = `**${prompt.name}**${kindBadge}${publishBadge}\n\nšŸ”‘ Key: ${prompt.key}\nšŸ“‚ Source: Workspace\nšŸ“„ ${prompt.description || 'No description'}\nšŸ·ļø Tags: ${prompt.tags?.join(', ') || 'None'}${toolsLine}\nšŸ“Œ Kind: ${prompt.kind}\nšŸ“¤ Publishable: ${prompt.publishable}\nšŸ“Š Status: ${prompt.publishing?.status || 'unknown'}\n\n**Content:**\n\`\`\`\n${prompt.content || '(No content)'}\n\`\`\``;
1491
1498
 
1492
1499
  return {
1493
1500
  content: [
@@ -29,8 +29,9 @@ function formatUnifiedResults(items = [], { total = 0, page = 1, pageSize = 10 }
29
29
  const publishable = entry?.publishable !== undefined ? ` šŸ“” Publishable: ${entry.publishable}\n` : '';
30
30
  const status = entry?.publishing?.status ? ` šŸ“Š Status: ${entry.publishing.status}\n` : '';
31
31
  const project = entry?.project ? ` šŸ—ļø Project: ${entry.project}\n` : '';
32
+ const tools = Array.isArray(entry?.tools) && entry.tools.length ? ` šŸ› ļø Tools: ${entry.tools.join(', ')}\n` : '';
32
33
 
33
- return `${absoluteIndex}. **${promptName}**\n šŸ“œ ${description}\n${kind}${publishable}${status}${project}${libraryName}${cidLine} šŸ”– Tags: ${tags}\n 🌐 Source: ${origin}\n`;
34
+ return `${absoluteIndex}. **${promptName}**\n šŸ“œ ${description}\n${kind}${publishable}${status}${project}${tools}${libraryName}${cidLine} šŸ”– Tags: ${tags}\n 🌐 Source: ${origin}\n`;
34
35
  }).join('\n');
35
36
 
36
37
  return head + lines;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sage-protocol/cli",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "Sage Protocol CLI for managing AI prompt libraries",
5
5
  "bin": {
6
6
  "sage": "./bin/sage.js"