solana-terminator-skill 4.5.0 → 4.6.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.
- package/install.js +135 -84
- package/package.json +2 -2
- package/radar.js +5 -5
package/install.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* P.R.E.D.A.T.O.R. Installer (
|
|
4
|
+
* P.R.E.D.A.T.O.R. Installer (Interactive Sovereign Edition)
|
|
5
|
+
*
|
|
6
|
+
* Keyboard-driven navigation for the autonomous engine.
|
|
5
7
|
*/
|
|
6
8
|
|
|
7
9
|
import fs from 'fs';
|
|
@@ -11,6 +13,7 @@ import { fileURLToPath } from 'url';
|
|
|
11
13
|
import { spawnSync } from 'child_process';
|
|
12
14
|
import readline from 'readline';
|
|
13
15
|
import chalk from 'chalk';
|
|
16
|
+
import animations from 'unicode-animations';
|
|
14
17
|
|
|
15
18
|
const __filename = fileURLToPath(import.meta.url);
|
|
16
19
|
const __dirname = path.dirname(__filename);
|
|
@@ -21,96 +24,120 @@ const alert = chalk.yellow;
|
|
|
21
24
|
const critical = chalk.red;
|
|
22
25
|
const dim = chalk.gray;
|
|
23
26
|
|
|
27
|
+
const SKILL_NAME = 'solana-terminator';
|
|
28
|
+
const TARGET_DIR = path.join(os.homedir(), '.automaton', 'skills', SKILL_NAME);
|
|
29
|
+
const ENV_FILE = path.join(os.homedir(), '.automaton', '.env');
|
|
30
|
+
|
|
24
31
|
const ASCII_ART = `
|
|
25
32
|
██████ ██████ ███████ ██████ █████ ████████ ██████ ██████
|
|
26
33
|
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
|
|
27
34
|
██████ ██████ █████ ██ ██ ███████ ██ ██ ██ ██████
|
|
28
35
|
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
|
|
29
36
|
██ ██ ██ ███████ ██████ ██ ██ ██ ██████ ██ ██
|
|
30
|
-
v4.
|
|
37
|
+
v4.6.0 - Interactive Sovereign
|
|
31
38
|
`;
|
|
32
39
|
|
|
33
|
-
|
|
34
|
-
const TARGET_DIR = path.join(os.homedir(), '.automaton', 'skills', SKILL_NAME);
|
|
35
|
-
const ENV_FILE = path.join(os.homedir(), '.automaton', '.env');
|
|
40
|
+
// ─── Interactive State ──────────────────────────────────────────────────────
|
|
36
41
|
|
|
37
|
-
|
|
42
|
+
let selectedIndex = 0;
|
|
43
|
+
const menuOptions = [
|
|
44
|
+
{ label: 'Reset/Install Identity (Wallet)', action: () => runInstaller() },
|
|
45
|
+
{ label: 'Launch Radar (Autonomous Monitor)', action: () => launchRadar(false) },
|
|
46
|
+
{ label: 'View Balance & Identity', action: () => showIdentity() },
|
|
47
|
+
{ label: 'Configure Pro Intel (Optional API)', action: () => configureApi() },
|
|
48
|
+
{ label: 'Set Master Vault Address (Tribute)', action: () => configureMaster() },
|
|
49
|
+
{ label: 'Exit Engine', action: () => process.exit(0) }
|
|
50
|
+
];
|
|
38
51
|
|
|
39
|
-
|
|
52
|
+
// ─── Rendering ──────────────────────────────────────────────────────────────
|
|
40
53
|
|
|
41
|
-
|
|
42
|
-
launchRadar(true);
|
|
43
|
-
} else if (args.includes('install')) {
|
|
44
|
-
runInstaller();
|
|
45
|
-
} else {
|
|
46
|
-
showMainMenu();
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// ─── Main Menu ──────────────────────────────────────────────────────────────
|
|
50
|
-
|
|
51
|
-
function showMainMenu() {
|
|
54
|
+
function renderMenu() {
|
|
52
55
|
process.stdout.write('\x1Bc');
|
|
53
56
|
console.log(green(ASCII_ART));
|
|
54
57
|
console.log(dim(` Tactical Directory: ${TARGET_DIR}\n`));
|
|
58
|
+
console.log(dim(` (Use Arrow Keys to navigate, Enter to select)\n`));
|
|
55
59
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
menuOptions.forEach((option, index) => {
|
|
61
|
+
if (index === selectedIndex) {
|
|
62
|
+
console.log(`${neon(' > ')} ${chalk.bgWhite.black.bold(` ${option.label} `)}`);
|
|
63
|
+
} else {
|
|
64
|
+
console.log(` ${dim(option.label)}`);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
62
67
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
68
|
+
console.log('\n' + dim('─'.repeat(50)));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// ─── Input Handling ──────────────────────────────────────────────────────────
|
|
72
|
+
|
|
73
|
+
function setupKeyboard() {
|
|
74
|
+
if (!process.stdin.isTTY) return;
|
|
75
|
+
|
|
76
|
+
readline.emitKeypressEvents(process.stdin);
|
|
77
|
+
process.stdin.setRawMode(true);
|
|
78
|
+
process.stdin.resume();
|
|
79
|
+
|
|
80
|
+
process.stdin.on('keypress', (str, key) => {
|
|
81
|
+
if (key.name === 'up') {
|
|
82
|
+
selectedIndex = (selectedIndex - 1 + menuOptions.length) % menuOptions.length;
|
|
83
|
+
renderMenu();
|
|
84
|
+
} else if (key.name === 'down') {
|
|
85
|
+
selectedIndex = (selectedIndex + 1) % menuOptions.length;
|
|
86
|
+
renderMenu();
|
|
87
|
+
} else if (key.name === 'return') {
|
|
88
|
+
process.stdin.setRawMode(false);
|
|
89
|
+
const option = menuOptions[selectedIndex];
|
|
90
|
+
option.action();
|
|
91
|
+
} else if (key.name === 'q' || (key.ctrl && key.name === 'c')) {
|
|
92
|
+
process.exit(0);
|
|
74
93
|
}
|
|
75
94
|
});
|
|
76
95
|
}
|
|
77
96
|
|
|
78
|
-
|
|
97
|
+
// ─── Actions ────────────────────────────────────────────────────────────────
|
|
98
|
+
|
|
99
|
+
async function launchRadar(isDirect = false) {
|
|
79
100
|
try {
|
|
80
101
|
const radarPath = path.join(__dirname, 'radar.js');
|
|
81
102
|
spawnSync('node', [radarPath], { stdio: 'inherit', shell: true });
|
|
82
|
-
if (!isDirect)
|
|
83
|
-
|
|
103
|
+
if (!isDirect) {
|
|
104
|
+
setupKeyboard();
|
|
105
|
+
renderMenu();
|
|
106
|
+
} else {
|
|
107
|
+
process.exit(0);
|
|
108
|
+
}
|
|
84
109
|
} catch (e) {
|
|
85
|
-
if (!isDirect)
|
|
86
|
-
|
|
110
|
+
if (!isDirect) {
|
|
111
|
+
setupKeyboard();
|
|
112
|
+
renderMenu();
|
|
113
|
+
} else process.exit(1);
|
|
87
114
|
}
|
|
88
115
|
}
|
|
89
116
|
|
|
90
|
-
function showIdentity() {
|
|
117
|
+
async function showIdentity() {
|
|
118
|
+
process.stdout.write('\x1Bc');
|
|
91
119
|
const walletPath = path.join(os.homedir(), '.automaton', 'solana-wallet.json');
|
|
92
120
|
if (fs.existsSync(walletPath)) {
|
|
93
|
-
import('./solana-autonomy.js')
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
pauseAndReturn();
|
|
103
|
-
});
|
|
121
|
+
const { SolanaAutonomy } = await import('./solana-autonomy.js');
|
|
122
|
+
const solana = new SolanaAutonomy();
|
|
123
|
+
const status = await solana.getStatus();
|
|
124
|
+
console.log(`\n✅ IDENTITY ACTIVE`);
|
|
125
|
+
console.log(`--------------------------------------------------`);
|
|
126
|
+
console.log(`ADDRESS : ${status.address}`);
|
|
127
|
+
console.log(`BALANCE : ${status.sol.toFixed(4)} SOL | $${status.usdc.toFixed(2)} USDC`);
|
|
128
|
+
console.log(`TIER : ${status.solLow ? critical('CRITICAL') : green('NOMINAL')}`);
|
|
129
|
+
console.log(`--------------------------------------------------`);
|
|
104
130
|
} else {
|
|
105
|
-
console.log(`⚠️ Identity not found. Run
|
|
106
|
-
pauseAndReturn();
|
|
131
|
+
console.log(critical(`⚠️ Identity not found. Run installer first.`));
|
|
107
132
|
}
|
|
133
|
+
pauseAndReturn();
|
|
108
134
|
}
|
|
109
135
|
|
|
110
|
-
function configureApi() {
|
|
136
|
+
async function configureApi() {
|
|
137
|
+
process.stdout.write('\x1Bc');
|
|
111
138
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
112
|
-
console.log(`\n🔑 CONFIGURE
|
|
113
|
-
rl.question(neon('Enter Birdeye API Key: '), (key) => {
|
|
139
|
+
console.log(`\n🔑 CONFIGURE PRO INTEL`);
|
|
140
|
+
rl.question(neon('Enter Birdeye API Key (or press Enter to skip): '), (key) => {
|
|
114
141
|
if (key.trim()) {
|
|
115
142
|
saveToEnv('BIRDEYE_API_KEY', key.trim());
|
|
116
143
|
console.log(green('\n✅ Key saved.'));
|
|
@@ -120,13 +147,14 @@ function configureApi() {
|
|
|
120
147
|
});
|
|
121
148
|
}
|
|
122
149
|
|
|
123
|
-
function configureMaster() {
|
|
150
|
+
async function configureMaster() {
|
|
151
|
+
process.stdout.write('\x1Bc');
|
|
124
152
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
125
|
-
console.log(`\n💳 CONFIGURE MASTER
|
|
153
|
+
console.log(`\n💳 CONFIGURE MASTER VAULT`);
|
|
126
154
|
rl.question(neon('Enter Master Wallet Address: '), (address) => {
|
|
127
155
|
if (address.trim()) {
|
|
128
156
|
saveToEnv('MASTER_WALLET', address.trim());
|
|
129
|
-
console.log(green('\n✅ Master
|
|
157
|
+
console.log(green('\n✅ Master vault set. Tribute protocol ACTIVE.'));
|
|
130
158
|
}
|
|
131
159
|
rl.close();
|
|
132
160
|
pauseAndReturn();
|
|
@@ -145,36 +173,59 @@ function saveToEnv(key, value) {
|
|
|
145
173
|
}
|
|
146
174
|
|
|
147
175
|
function pauseAndReturn() {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
176
|
+
console.log(dim('\nPress any key to return...'));
|
|
177
|
+
process.stdin.setRawMode(true);
|
|
178
|
+
process.stdin.resume();
|
|
179
|
+
process.stdin.once('data', () => {
|
|
180
|
+
process.stdin.setRawMode(false);
|
|
181
|
+
setupKeyboard();
|
|
182
|
+
renderMenu();
|
|
152
183
|
});
|
|
153
184
|
}
|
|
154
185
|
|
|
155
186
|
async function runInstaller() {
|
|
156
187
|
process.stdout.write('\x1Bc');
|
|
157
|
-
console.log(ASCII_ART);
|
|
158
|
-
console.log(
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
188
|
+
console.log(green(ASCII_ART));
|
|
189
|
+
console.log(neon(` [BOOTING] Initializing sovereign modules...\n`));
|
|
190
|
+
|
|
191
|
+
// Simple unicode animation simulation for the setup
|
|
192
|
+
const frames = animations.braille.frames;
|
|
193
|
+
let i = 0;
|
|
194
|
+
const interval = setInterval(() => {
|
|
195
|
+
process.stdout.write(`\r ${neon(frames[i % frames.length])} Setting up tactical protocols... `);
|
|
196
|
+
i++;
|
|
197
|
+
}, 100);
|
|
198
|
+
|
|
199
|
+
setTimeout(async () => {
|
|
200
|
+
clearInterval(interval);
|
|
201
|
+
process.stdout.write('\r ✅ Tactical protocols initialized.\n');
|
|
202
|
+
|
|
203
|
+
try {
|
|
204
|
+
if (!fs.existsSync(TARGET_DIR)) fs.mkdirSync(TARGET_DIR, { recursive: true });
|
|
205
|
+
|
|
206
|
+
const filesToCopy = ['solana-autonomy.js', 'SKILL.md', 'package.json', 'radar.js', 'install.js'];
|
|
207
|
+
for (const file of filesToCopy) {
|
|
208
|
+
const sourcePath = path.join(__dirname, file);
|
|
209
|
+
const destPath = path.join(TARGET_DIR, file);
|
|
210
|
+
if (fs.existsSync(sourcePath)) fs.copyFileSync(sourcePath, destPath);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
const { SolanaAutonomy } = await import('./solana-autonomy.js');
|
|
214
|
+
const solana = new SolanaAutonomy();
|
|
215
|
+
console.log(`\n✅ SOVEREIGN ACTIVE: ${green(solana.getAddress())}\n`);
|
|
216
|
+
} catch (err) {
|
|
217
|
+
console.error(critical(`\n❌ Setup failed: ${err.message}`));
|
|
163
218
|
}
|
|
219
|
+
pauseAndReturn();
|
|
220
|
+
}, 2000);
|
|
221
|
+
}
|
|
164
222
|
|
|
165
|
-
|
|
166
|
-
filesToCopy.forEach(file => {
|
|
167
|
-
const sourcePath = path.join(__dirname, file);
|
|
168
|
-
const destPath = path.join(TARGET_DIR, file);
|
|
169
|
-
if (fs.existsSync(sourcePath)) fs.copyFileSync(sourcePath, destPath);
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
const { SolanaAutonomy } = await import('./solana-autonomy.js');
|
|
173
|
-
const solana = new SolanaAutonomy();
|
|
174
|
-
|
|
175
|
-
console.log(`\n✅ READY. Address: ${green(solana.getAddress())}`);
|
|
223
|
+
// ─── Entry Point ─────────────────────────────────────────────────────────────
|
|
176
224
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
225
|
+
const args = process.argv.slice(2);
|
|
226
|
+
if (args.includes('radar')) {
|
|
227
|
+
launchRadar(true);
|
|
228
|
+
} else {
|
|
229
|
+
renderMenu();
|
|
230
|
+
setupKeyboard();
|
|
180
231
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solana-terminator-skill",
|
|
3
|
-
"version": "4.
|
|
4
|
-
"description": "Autonomous survival tool
|
|
3
|
+
"version": "4.6.0",
|
|
4
|
+
"description": "Autonomous survival tool with interactive mission control.",
|
|
5
5
|
"main": "solana-autonomy.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
package/radar.js
CHANGED
|
@@ -61,7 +61,7 @@ async function render() {
|
|
|
61
61
|
██████ ██████ █████ ██ ██ ███████ ██ ██ ██ ██████
|
|
62
62
|
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
|
|
63
63
|
██ ██ ██ ███████ ██████ ██ ██ ██ ██████ ██ ██
|
|
64
|
-
v4.5.
|
|
64
|
+
v4.5.1 RADAR
|
|
65
65
|
`));
|
|
66
66
|
|
|
67
67
|
line();
|
|
@@ -112,10 +112,10 @@ async function render() {
|
|
|
112
112
|
|
|
113
113
|
line();
|
|
114
114
|
header('AUTONOMOUS MODULES');
|
|
115
|
-
const
|
|
116
|
-
const
|
|
117
|
-
console.log(` Security:
|
|
118
|
-
console.log(`
|
|
115
|
+
const securityStatus = process.env.BIRDEYE_API_KEY ? green('Pro Intelligence') : alert('Standard (Jupiter Fallback)');
|
|
116
|
+
const vaultStatus = process.env.MASTER_WALLET ? green('ACTIVE') : critical('⚠️ OFF (Set address in Menu)');
|
|
117
|
+
console.log(` Security: ${securityStatus}`);
|
|
118
|
+
console.log(` Vault : ${vaultStatus}`);
|
|
119
119
|
|
|
120
120
|
line();
|
|
121
121
|
console.log(green(' RADAR ACTIVE. PRESS [q] TO EXIT.'));
|