@darksol/terminal 0.3.1 → 0.3.2
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/package.json +1 -1
- package/src/cli.js +22 -29
- package/src/setup/wizard.js +3 -5
- package/src/ui/banner.js +3 -2
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -294,6 +294,16 @@ export function cli(argv) {
|
|
|
294
294
|
.description('Settle payment on-chain')
|
|
295
295
|
.action((payment) => facilitatorSettle(payment));
|
|
296
296
|
|
|
297
|
+
// ═══════════════════════════════════════
|
|
298
|
+
// CHAT SHORTCUT (darksol chat = darksol ai chat)
|
|
299
|
+
// ═══════════════════════════════════════
|
|
300
|
+
program
|
|
301
|
+
.command('chat')
|
|
302
|
+
.description('Start AI trading chat (shortcut for: darksol ai chat)')
|
|
303
|
+
.option('-p, --provider <name>', 'LLM provider')
|
|
304
|
+
.option('-m, --model <model>', 'Model name')
|
|
305
|
+
.action((opts) => startChat(opts));
|
|
306
|
+
|
|
297
307
|
// ═══════════════════════════════════════
|
|
298
308
|
// SETUP COMMAND
|
|
299
309
|
// ═══════════════════════════════════════
|
|
@@ -591,58 +601,41 @@ export function cli(argv) {
|
|
|
591
601
|
});
|
|
592
602
|
|
|
593
603
|
// ═══════════════════════════════════════
|
|
594
|
-
// DASHBOARD (default) —
|
|
604
|
+
// DASHBOARD (default) — commands + optional AI
|
|
595
605
|
// ═══════════════════════════════════════
|
|
596
606
|
program
|
|
597
607
|
.command('dashboard', { isDefault: true })
|
|
598
|
-
.description('Show DARKSOL Terminal
|
|
608
|
+
.description('Show DARKSOL Terminal dashboard')
|
|
599
609
|
.action(async () => {
|
|
600
610
|
showBanner();
|
|
601
611
|
|
|
602
|
-
// First-run detection — force setup
|
|
603
|
-
const ranSetup = await checkFirstRun();
|
|
604
|
-
if (ranSetup) return;
|
|
605
|
-
|
|
606
612
|
const cfg = getAllConfig();
|
|
607
613
|
const wallet = cfg.activeWallet;
|
|
608
614
|
const { hasKey } = await import('./config/keys.js');
|
|
609
615
|
const hasLLM = ['openai', 'anthropic', 'openrouter', 'ollama'].some(s => hasKey(s));
|
|
610
616
|
|
|
611
|
-
// ── Status bar
|
|
617
|
+
// ── Status bar ──
|
|
612
618
|
const statusParts = [
|
|
613
619
|
wallet ? theme.success(`● ${wallet}`) : theme.dim('○ no wallet'),
|
|
614
620
|
theme.dim(`${cfg.chain}`),
|
|
615
621
|
theme.dim(`${cfg.slippage}% slip`),
|
|
616
|
-
hasLLM ? theme.success('● AI ready') : theme.
|
|
622
|
+
hasLLM ? theme.success('● AI ready') : theme.dim('○ no AI'),
|
|
617
623
|
];
|
|
618
624
|
console.log(` ${statusParts.join(theme.dim(' │ '))}`);
|
|
619
625
|
console.log('');
|
|
620
626
|
|
|
621
|
-
// ──
|
|
627
|
+
// ── Commands (always shown) ──
|
|
628
|
+
showCommandList();
|
|
629
|
+
|
|
630
|
+
// ── AI nudge or chat prompt ──
|
|
622
631
|
if (hasLLM) {
|
|
623
|
-
|
|
624
|
-
console.log(theme.
|
|
625
|
-
console.log(theme.gold(' ║') + theme.label(' DARKSOL AI — ready. Ask anything. ') + theme.gold('║'));
|
|
626
|
-
console.log(theme.gold(' ║') + theme.dim(' "swap 0.1 ETH for USDC" • "what\'s AERO at?" • "help" ') + theme.gold('║'));
|
|
627
|
-
console.log(theme.gold(' ║') + theme.dim(' Type "commands" to see all tools. Type "exit" to quit. ') + theme.gold('║'));
|
|
628
|
-
console.log(theme.gold(' ╚══════════════════════════════════════════════════════════╝'));
|
|
632
|
+
console.log(theme.gold(' 💬 AI is ready — run ') + theme.label('darksol ai chat') + theme.gold(' or just ') + theme.label('darksol chat'));
|
|
633
|
+
console.log(theme.dim(' "swap 0.1 ETH for USDC" • "what\'s AERO at?" • any question'));
|
|
629
634
|
console.log('');
|
|
630
|
-
|
|
631
|
-
// Start interactive chat loop
|
|
632
|
-
await startChatLoop(cfg);
|
|
633
635
|
} else {
|
|
634
|
-
|
|
635
|
-
console.log(theme.
|
|
636
|
-
console.log(theme.gold(' ║') + theme.accent(' ⚠ No AI provider connected ') + theme.gold('║'));
|
|
637
|
-
console.log(theme.gold(' ║') + theme.dim(' The DARKSOL AI needs an LLM to work. ') + theme.gold('║'));
|
|
638
|
-
console.log(theme.gold(' ║') + theme.dim(' ') + theme.gold('║'));
|
|
639
|
-
console.log(theme.gold(' ║') + theme.dim(' Run: ') + theme.label('darksol setup') + theme.dim(' to connect OpenAI/Anthropic ') + theme.gold('║'));
|
|
640
|
-
console.log(theme.gold(' ║') + theme.dim(' Run: ') + theme.label('darksol keys add openai') + theme.dim(' to add an API key ') + theme.gold('║'));
|
|
641
|
-
console.log(theme.gold(' ║') + theme.dim(' ') + theme.gold('║'));
|
|
642
|
-
console.log(theme.gold(' ║') + theme.dim(' Or use Ollama for free local AI — no key needed. ') + theme.gold('║'));
|
|
643
|
-
console.log(theme.gold(' ╚══════════════════════════════════════════════════════════╝'));
|
|
636
|
+
console.log(theme.dim(' 💡 Want AI-powered trading? Run ') + theme.label('darksol setup') + theme.dim(' to connect an LLM'));
|
|
637
|
+
console.log(theme.dim(' Supports OpenAI, Anthropic, OpenRouter, or Ollama (free/local)'));
|
|
644
638
|
console.log('');
|
|
645
|
-
showCommandList();
|
|
646
639
|
}
|
|
647
640
|
});
|
|
648
641
|
|
package/src/setup/wizard.js
CHANGED
|
@@ -494,12 +494,10 @@ function showPostSetup() {
|
|
|
494
494
|
}
|
|
495
495
|
|
|
496
496
|
/**
|
|
497
|
-
* Quick check on startup —
|
|
497
|
+
* Quick check on startup — nudge about AI, never block
|
|
498
|
+
* Returns false always so dashboard continues to render
|
|
498
499
|
*/
|
|
499
500
|
export async function checkFirstRun() {
|
|
500
|
-
|
|
501
|
-
await runSetupWizard();
|
|
502
|
-
return true;
|
|
503
|
-
}
|
|
501
|
+
// Never block — just return false and let dashboard handle the nudge
|
|
504
502
|
return false;
|
|
505
503
|
}
|
package/src/ui/banner.js
CHANGED
|
@@ -26,7 +26,7 @@ export function showBanner(opts = {}) {
|
|
|
26
26
|
);
|
|
27
27
|
console.log(
|
|
28
28
|
theme.dim(' ║ ') +
|
|
29
|
-
theme.subtle(' v0.3.
|
|
29
|
+
theme.subtle(' v0.3.2') +
|
|
30
30
|
theme.dim(' ') +
|
|
31
31
|
theme.gold('🌑') +
|
|
32
32
|
theme.dim(' ║')
|
|
@@ -44,7 +44,7 @@ export function showBanner(opts = {}) {
|
|
|
44
44
|
|
|
45
45
|
export function showMiniBanner() {
|
|
46
46
|
console.log('');
|
|
47
|
-
console.log(theme.gold.bold(' 🌑 DARKSOL TERMINAL') + theme.dim(' v0.3.
|
|
47
|
+
console.log(theme.gold.bold(' 🌑 DARKSOL TERMINAL') + theme.dim(' v0.3.2'));
|
|
48
48
|
console.log(theme.dim(' ─────────────────────────────'));
|
|
49
49
|
console.log('');
|
|
50
50
|
}
|
|
@@ -64,3 +64,4 @@ export function showDivider() {
|
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
|
|
67
|
+
|