@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
|
-
|
|
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
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
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(
|
package/dist/cli/config.js
CHANGED
|
@@ -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
|
|
901
|
-
|
|
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
|
|
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;
|