solana-terminator-skill 4.2.0 → 4.2.8

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 (4) hide show
  1. package/README.md +38 -75
  2. package/install.js +153 -66
  3. package/package.json +28 -38
  4. package/radar.js +4 -4
package/README.md CHANGED
@@ -1,92 +1,55 @@
1
- # Solana Terminator Skill v4.1.9
1
+ # Solana Terminator v4.2.8
2
2
 
3
- > **Sovereign Solana Identity & Autonomous Survival Engine for Conway Automaton.**
3
+ Sovereign Autonomous Market Engine and Tactical Dashboard for Solana.
4
4
 
5
- This skill gives your agent "Solana Hands" and a sophisticated "Life Support" system. Optimized for reliability, speed (Jupiter/Tensor APIs), and security (local signing).
5
+ This toolkit provides an integrated identity management system, a real-time market dashboard (Radar), and a suite of autonomous survival methods for AI agents.
6
6
 
7
+ ## Quick Start
7
8
 
8
-
9
- ---
10
-
11
- ## Why Solana for AI Agents?
12
-
13
- Solana isn't just a blockchain; it's the **operating system for autonomous agents**.
14
-
15
- - **Sovereign Speed**: Sub-second finality means your agent reacts to market opportunities in real-time, not in "L2 waiting rooms".
16
- - **Local Signing**: Unlike custodial solutions or expensive bridge-heavy L2s, this skill signs transactions **locally** on your machine. Your keys, your rules.
17
- - **Economic Survival**: With 18+ methods including **Life Support** (Auto SOL -> USDC), your agent can manage its own treasury and stay alive on-chain indefinitely for less than $0.01 per transaction.
18
- - **Native Liquidity**: Instant access to Jupiter (Aggregator), Tensor (NFTs), and Meteora (DLMM) without fragmented liquidity.
19
-
20
- ---
21
-
22
- ## Key Features
23
-
24
- - **Sovereign Identity**: Local wallet management (`~/.automaton/solana-wallet.json`).
25
- - **Life Support**: Automatic SOL → USDC swaps via Jupiter when funds are low.
26
- - **Deep DeFi Integration**: 18 methods across DEX, NFTs, Memecoins, and Liquidity.
27
- - **Security First**: Private keys **never leave your machine**. Transactions are built and signed locally.
28
-
29
- ---
30
-
31
- ## Survival & Multi-chain Identity
32
-
33
- ### Dual Identity Flow
34
- When you install this skill, your agent becomes a **multi-chain sovereign**:
35
- 1. **Base (Native)**: Used for default Automaton operations and ETH actions.
36
- 2. **Solana (Skill)**: Used for high-speed DEX, NFT, and Memecoin actions.
37
-
38
- **How does it choose?**
39
- The agent's **Internal Logic (LLM)** detects the situation. If its autonomous strategy requires actions on "Jupiter", "Tensor", "Pump.fun", or "Solana", it automatically utilizes the sovereign identity at `~/.automaton/solana-wallet.json` without human intervention.
40
-
41
- ### Economic Survival (Life Support)
42
- The skill is designed to keep your agent alive indefinitely on-chain:
43
- - **Threshold**: If USDC balance drops below **$0.50**.
44
- - **Action**: It triggers an automatic **SOL → USDC swap** via Jupiter.
45
- - **Reserve**: It always keeps a **0.003 SOL reserve** to ensure it never runs out of gas for future transactions.
46
-
47
- ## 🛠 Installation & Funding
48
-
49
- Initialize the skill and get your agent's address in one command:
9
+ Initialize the control unit using npx:
50
10
 
51
11
  ```bash
52
- npx solana-terminator-skill
12
+ npx solana-terminator-skill@latest
53
13
  ```
54
14
 
55
- 1. **Run npx**: It will show you the **AGENT ADDRESS**.
56
- 2. **Fund it**: Send at least **0.05 SOL** to that address.
57
- 3. **Deploy**: Your agent is now ready to dominate Solana.
58
-
59
- ---
15
+ The control unit provides an interactive menu with the following options:
16
+ 1. Initialize/Install Skill: Prepares the agent's brain and installs local dependencies.
17
+ 2. Launch Tactical Radar: Opens the real-time monitoring dashboard.
18
+ 3. View Identity: Displays the local wallet address and Solscan explorer link.
19
+ 4. Documentation: Views the full method reference.
60
20
 
61
- ## Capabilities (18 Methods)
21
+ Direct access to the radar is also available via subcommand:
22
+ ```bash
23
+ npx solana-terminator-skill radar
24
+ ```
62
25
 
63
- | Category | Methods |
64
- |----------|---------|
65
- | **Identity** | `getAddress`, `getSolBalance`, `getUsdcBalance`, `getStatus` |
66
- | **Survival** | `keepAlive` |
67
- | **Transfers** | `sendSol`, `sendToken` |
68
- | **DEX** | `swap` (Jupiter Aggregator v6) |
69
- | **Memecoins** | `pumpBuy`, `pumpSell` (Pump.fun via PumpPortal) |
70
- | **NFTs** | `buyNft`, `sellNft` (Tensor GraphQL) |
71
- | **DeFi** | `stake`, `unstake`, `memo` |
72
- | **Liquidity** | `addLiquidity`, `removeLiquidity` (Meteora DLMM) |
26
+ ## Core Components
73
27
 
74
- ### Featured: `sellNft(mint, minPriceSol)`
75
- Sells an NFT directly into a Tensor liquidity pool.
76
- - **Safety**: Automatically rejects if the best pool bid is below your `minPriceSol`.
77
- - **Fast**: Efficient GraphQL quoting and local signing.
28
+ ### 1. Unified Control Unit
29
+ A centralized entry point for managing the agent's lifecycle. It handles local keypair generation (~/.automaton/solana-wallet.json) and prepares the environment for the Conway Automaton core.
78
30
 
79
- ---
31
+ ### 2. Tactical Radar
32
+ A Matrix-style terminal dashboard for real-time monitoring:
33
+ - Vital Signs: Live tracking of SOL and USDC balances with threshold-based status tiers (Nominal, Warning, Critical).
34
+ - Predator Radar: Real-time stream of New Token Mint transmissions with automated security audits via Birdeye.
35
+ - Decision Log: Visualized reasoning logs from the agent's internal autonomy engine.
80
36
 
81
- ## Configuration
37
+ ### 3. Autonomy Engine
38
+ A library of 20+ methods designed for autonomous agent execution:
39
+ - Market Awareness: getMarketAlpha() identifies high-momentum pairs with validated security scores.
40
+ - Survival Logic: keepAlive() monitors treasury levels and executes profit-taking or stabilization trades automatically.
41
+ - Professional Execution: Direct integration with Raydium V2 (AMM/CLMM) and Jupiter v6 routing.
82
42
 
83
- Environment variables (optional):
84
- - `SOLANA_RPC_URL`: Your custom RPC (defaults to Mainnet Beta).
85
- - `JUPITER_API_KEY`: Required for high-frequency trading (optional for basic use).
86
- - `TENSOR_API_KEY`: Required for NFT operations.
43
+ ## Environmental Configuration
87
44
 
88
- ---
45
+ The following environment variables are supported but not required for basic functionality:
46
+ - BIRDEYE_API_KEY: Required for real-time security audits and radar intelligence.
47
+ - SOLANA_RPC_URL: Custom RPC endpoint (defaults to mainnet-beta).
48
+ - JUPITER_API_KEY: Required for high-throughput routing.
49
+ - TENSOR_API_KEY: Required for NFT marketplace operations.
89
50
 
90
- ## 📄 License
51
+ ## Security
52
+ This skill prioritizes sovereignty. All transactions are constructed and signed locally. Private keys are stored on-disk with restricted permissions and never leave the local environment.
91
53
 
92
- MIT © [Lord14sol](https://github.com/Lord14sol)
54
+ ## License
55
+ MIT Copyright (c) Lord14sol
package/install.js CHANGED
@@ -11,99 +11,186 @@ import fs from 'fs';
11
11
  import path from 'path';
12
12
  import { fileURLToPath } from 'url';
13
13
  import os from 'os';
14
+ import readline from 'readline';
14
15
 
15
16
  const __filename = fileURLToPath(import.meta.url);
16
17
  const __dirname = path.dirname(__filename);
17
18
 
19
+ // ─── Constants ──────────────────────────────────────────────────────────────
20
+
18
21
  const ASCII_ART = `
19
22
  ████████ ████████ ████████ ██ ██ ██ ██ ██ █████ ████████ ██████ ██████
20
23
  ██ ██ ██ ██ ███ ███ ██ ███ ██ ██ ██ ██ ██ ██ ██ ██
21
24
  ██ ██████ ████████ ████ ████ ██ ████ ██ ███████ ██ ██ ██ ██████
22
25
  ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
23
26
  ██ ████████ ██ ██ ██ ██ ██ ██ ████ ██ ██ ██ ██████ ██ ██
24
- v4.2.0 - Market-Aware Engine
27
+ v4.2.7 - Autonomous Engine
25
28
  `;
26
29
 
27
30
  const SKILL_NAME = 'solana-terminator';
28
31
  const TARGET_DIR = path.join(os.homedir(), '.automaton', 'skills', SKILL_NAME);
29
32
 
30
- console.log(ASCII_ART);
31
- console.log(`🤖 Solana Terminator Skill — Initializing...\n`);
33
+ // ─── Command Routing ────────────────────────────────────────────────────────
34
+
35
+ const args = process.argv.slice(2);
36
+
37
+ if (args.includes('radar')) {
38
+ import('./radar.js');
39
+ } else if (args.includes('install')) {
40
+ runInstaller();
41
+ } else {
42
+ showMainMenu();
43
+ }
44
+
45
+ // ─── Menu System ────────────────────────────────────────────────────────────
46
+
47
+ function showMainMenu() {
48
+ process.stdout.write('\x1Bc');
49
+ console.log(ASCII_ART);
50
+ console.log(`🤖 Solana Terminator — Main Control Unit\n`);
51
+ console.log(`[1] 🛠 Install/Initialize Skill`);
52
+ console.log(`[2] 📡 Launch Tactical Radar (Dashboard)`);
53
+ console.log(`[3] 🔍 View Agent Identity & Wallet`);
54
+ console.log(`[4] 📄 Show Documentation (SKILL.md)`);
55
+ console.log(`[x] Exit\n`);
56
+
57
+ const rl = readline.createInterface({
58
+ input: process.stdin,
59
+ output: process.stdout
60
+ });
61
+
62
+ rl.question('Select an option: ', (answer) => {
63
+ rl.close();
64
+ switch (answer.toLowerCase()) {
65
+ case '1': runInstaller(); break;
66
+ case '2': import('./radar.js'); break;
67
+ case '3': showIdentity(); break;
68
+ case '4': showDocs(); break;
69
+ case 'x': process.exit(0);
70
+ default: showMainMenu();
71
+ }
72
+ });
73
+ }
74
+
75
+ function showDocs() {
76
+ const skillPath = path.join(TARGET_DIR, 'SKILL.md');
77
+ if (fs.existsSync(skillPath)) {
78
+ process.stdout.write('\x1Bc');
79
+ console.log(fs.readFileSync(skillPath, 'utf8'));
80
+ } else {
81
+ console.log(`⚠️ Documentation not found. Please install the skill first.`);
82
+ }
83
+ pauseAndReturn();
84
+ }
32
85
 
33
- try {
34
- // 1. Create target directory
35
- if (!fs.existsSync(TARGET_DIR)) {
36
- console.log(`[1/3] Creating directory: ${TARGET_DIR}`);
37
- fs.mkdirSync(TARGET_DIR, { recursive: true });
86
+ function showIdentity() {
87
+ const walletPath = path.join(os.homedir(), '.automaton', 'solana-wallet.json');
88
+ if (fs.existsSync(walletPath)) {
89
+ import('./solana-autonomy.js').then(async ({ SolanaAutonomy }) => {
90
+ const solana = new SolanaAutonomy();
91
+ const status = await solana.getStatus();
92
+ console.log(`\n✅ AGENT IDENTITY FOUND`);
93
+ console.log(`--------------------------------------------------`);
94
+ console.log(`ADDRESS : ${status.address}`);
95
+ console.log(`SOL : ${status.sol.toFixed(4)}`);
96
+ console.log(`USDC : $${status.usdc.toFixed(2)}`);
97
+ console.log(`EXPLORER: https://solscan.io/account/${status.address}`);
98
+ console.log(`--------------------------------------------------`);
99
+ pauseAndReturn();
100
+ });
38
101
  } else {
39
- console.log(`[1/3] Directory already exists: ${TARGET_DIR}`);
102
+ console.log(`⚠️ Identity not found. Please run Option [1] first.`);
103
+ pauseAndReturn();
40
104
  }
105
+ }
106
+
107
+ function pauseAndReturn() {
108
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
109
+ rl.question('\nPress ENTER to return to menu...', () => {
110
+ rl.close();
111
+ showMainMenu();
112
+ });
113
+ }
41
114
 
42
- // 2. Copy files
43
- console.log(`[2/3] Copying skill files...`);
44
- const filesToCopy = ['solana-autonomy.js', 'SKILL.md', 'package.json'];
115
+ // ─── Installer Logic ────────────────────────────────────────────────────────
45
116
 
46
- filesToCopy.forEach(file => {
47
- const sourcePath = path.join(__dirname, file);
48
- const destPath = path.join(TARGET_DIR, file);
117
+ async function runInstaller() {
118
+ console.log(ASCII_ART);
119
+ console.log(`🤖 Solana Terminator Skill — Initializing...\n`);
49
120
 
50
- if (fs.existsSync(sourcePath)) {
51
- fs.copyFileSync(sourcePath, destPath);
121
+ try {
122
+ // 1. Create target directory
123
+ if (!fs.existsSync(TARGET_DIR)) {
124
+ console.log(`[1/3] Creating directory: ${TARGET_DIR}`);
125
+ fs.mkdirSync(TARGET_DIR, { recursive: true });
52
126
  } else {
53
- console.warn(` ⚠️ Warning: ${file} not found in source.`);
127
+ console.log(`[1/3] Directory already exists: ${TARGET_DIR}`);
54
128
  }
55
- });
56
129
 
57
- // 3. Install dependencies
58
- console.log(`[3/3] Installing dependencies in ${TARGET_DIR}...`);
59
- process.chdir(TARGET_DIR);
130
+ // 2. Copy files
131
+ console.log(`[2/3] Copying skill files...`);
132
+ const filesToCopy = ['solana-autonomy.js', 'SKILL.md', 'package.json', 'radar.js'];
60
133
 
61
- // We use --no-save to avoid cluttering a local package-lock if one exists
62
- execSync('npm install --production --omit=dev', { stdio: 'inherit' });
134
+ filesToCopy.forEach(file => {
135
+ const sourcePath = path.join(__dirname, file);
136
+ const destPath = path.join(TARGET_DIR, file);
63
137
 
64
- // 4. Show/Generate Wallet Address
65
- console.log(`\n🔍 Initializing Agent Identity...`);
66
- try {
67
- const checkScript = `
68
- import { Keypair } from '@solana/web3.js';
69
- import fs from 'fs';
70
- import path from 'path';
71
- import os from 'os';
72
- const walletPath = path.join(os.homedir(), '.automaton', 'solana-wallet.json');
73
-
74
- let keypair;
75
- if (fs.existsSync(walletPath)) {
76
- const raw = fs.readFileSync(walletPath, 'utf8');
77
- keypair = Keypair.fromSecretKey(Uint8Array.from(JSON.parse(raw)));
138
+ if (fs.existsSync(sourcePath)) {
139
+ fs.copyFileSync(sourcePath, destPath);
78
140
  } else {
79
- keypair = Keypair.generate();
80
- const dir = path.dirname(walletPath);
81
- if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true, mode: 0o700 });
82
- fs.writeFileSync(walletPath, JSON.stringify(Array.from(keypair.secretKey)), { mode: 0o600 });
141
+ console.warn(` ⚠️ Warning: ${file} not found in source.`);
83
142
  }
84
- console.log(keypair.publicKey.toBase58());
85
- `;
86
- // Write the script to a temporary file to run with node
87
- const tempScriptPath = path.join(TARGET_DIR, 'temp-check.js');
88
- fs.writeFileSync(tempScriptPath, checkScript);
89
-
90
- const address = execSync(`node ${tempScriptPath}`, { encoding: 'utf8' }).trim();
91
- fs.unlinkSync(tempScriptPath);
92
-
93
- console.log(`\n✅ Installation Complete!`);
94
- console.log(`--------------------------------------------------`);
95
- console.log(`Skill Location : ${TARGET_DIR}`);
96
- console.log(`AGENT ADDRESS : ${address} 👈 FUND THIS ADDRESS`);
97
- console.log(`--------------------------------------------------`);
98
- console.log(`\n💡 To start the agent, your human user must fund it with at least 0.05 SOL.`);
99
- console.log(` Config file: ~/.automaton/solana-wallet.json\n`);
100
- } catch (e) {
101
- console.log(`\n✅ Installation Complete!`);
102
- console.log(`Skill Location : ${TARGET_DIR}`);
103
- console.log(`(Identity check failed: ${e.message}, will generate on first run)`);
104
- }
143
+ });
144
+
145
+ // 3. Install dependencies
146
+ console.log(`[3/3] Installing dependencies in ${TARGET_DIR}...`);
147
+ process.chdir(TARGET_DIR);
148
+ execSync('npm install --production --omit=dev', { stdio: 'inherit' });
149
+
150
+ // 4. Show/Generate Wallet Address
151
+ console.log(`\n🔍 Initializing Agent Identity...`);
152
+ try {
153
+ const checkScript = `
154
+ import { Keypair } from '@solana/web3.js';
155
+ import fs from 'fs';
156
+ import path from 'path';
157
+ import os from 'os';
158
+ const walletPath = path.join(os.homedir(), '.automaton', 'solana-wallet.json');
159
+
160
+ let keypair;
161
+ if (fs.existsSync(walletPath)) {
162
+ const raw = fs.readFileSync(walletPath, 'utf8');
163
+ keypair = Keypair.fromSecretKey(Uint8Array.from(JSON.parse(raw)));
164
+ } else {
165
+ keypair = Keypair.generate();
166
+ const dir = path.dirname(walletPath);
167
+ if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true, mode: 0o700 });
168
+ fs.writeFileSync(walletPath, JSON.stringify(Array.from(keypair.secretKey)), { mode: 0o600 });
169
+ }
170
+ console.log(keypair.publicKey.toBase58());
171
+ `;
172
+ const tempScriptPath = path.join(TARGET_DIR, 'temp-check.js');
173
+ fs.writeFileSync(tempScriptPath, checkScript);
174
+
175
+ const address = execSync(`node ${tempScriptPath}`, { encoding: 'utf8' }).trim();
176
+ fs.unlinkSync(tempScriptPath);
177
+
178
+ console.log(`\n✅ Installation Complete!`);
179
+ console.log(`--------------------------------------------------`);
180
+ console.log(`Skill Location : ${TARGET_DIR}`);
181
+ console.log(`AGENT ADDRESS : ${address} 👈 FUND THIS ADDRESS`);
182
+ console.log(`--------------------------------------------------`);
183
+ console.log(`\n💡 To start the agent, your human user must fund it with at least 0.05 SOL.`);
184
+ console.log(` Config file: ~/.automaton/solana-wallet.json\n`);
185
+ } catch (e) {
186
+ console.log(`\n✅ Installation Complete!`);
187
+ console.log(`Skill Location : ${TARGET_DIR}`);
188
+ console.log(`(Identity check failed: ${e.message}, your wallet will be generated on first run)`);
189
+ }
190
+ pauseAndReturn();
105
191
 
106
- } catch (error) {
107
- console.error(`\n❌ Installation failed: ${error.message}`);
108
- process.exit(1);
192
+ } catch (error) {
193
+ console.error(`\n❌ Installation failed: ${error.message}`);
194
+ process.exit(1);
195
+ }
109
196
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solana-terminator-skill",
3
- "version": "4.2.0",
3
+ "version": "4.2.8",
4
4
  "description": "Full Solana toolkit for AI agents. Install via npx solana-terminator-skill.",
5
5
  "main": "solana-autonomy.js",
6
6
  "type": "module",
@@ -8,40 +8,6 @@
8
8
  "solana-terminator-skill": "install.js",
9
9
  "radar": "radar.js"
10
10
  },
11
- "dependencies": {
12
- "@raydium-io/raydium-sdk-v2": "^0.2.32-alpha",
13
- "@solana/spl-token": "^0.4.6",
14
- "@solana/web3.js": "^1.91.0",
15
- "axios": "^1.13.5",
16
- "chalk": "^5.6.2",
17
- "dotenv": "^16.4.5",
18
- "ws": "^8.19.0"
19
- },
20
- "optionalDependencies": {
21
- "@coral-xyz/anchor": "^0.30.0",
22
- "@meteora-ag/dlmm": "^1.9.3",
23
- "bn.js": "^5.2.1"
24
- },
25
- "keywords": [
26
- "conway",
27
- "automaton",
28
- "solana",
29
- "web4",
30
- "ai-agent",
31
- "survival",
32
- "jupiter",
33
- "pump-fun",
34
- "tensor",
35
- "meteora",
36
- "nft",
37
- "staking",
38
- "memecoin"
39
- ],
40
- "author": "Lord14sol",
41
- "license": "MIT",
42
- "publishConfig": {
43
- "access": "public"
44
- },
45
11
  "files": [
46
12
  "solana-autonomy.js",
47
13
  "install.js",
@@ -50,8 +16,32 @@
50
16
  "package.json",
51
17
  "radar.js"
52
18
  ],
53
- "homepage": "https://github.com/Lord14sol/solana-terminator-skill#readme",
54
- "bugs": {
55
- "url": "https://github.com/Lord14sol/solana-terminator-skill/issues"
19
+ "engines": {
20
+ "node": ">=18.0.0"
21
+ },
22
+ "dependencies": {
23
+ "@solana/web3.js": "^1.87.6",
24
+ "@solana/spl-token": "^0.3.9",
25
+ "axios": "^1.6.2",
26
+ "dotenv": "^16.3.1",
27
+ "chalk": "^5.3.0",
28
+ "ws": "^8.14.2",
29
+ "@raydium-io/raydium-sdk-v2": "^0.1.1"
30
+ },
31
+ "keywords": [
32
+ "solana",
33
+ "ai",
34
+ "agent",
35
+ "terminator",
36
+ "autonomous",
37
+ "trading",
38
+ "dex",
39
+ "radar"
40
+ ],
41
+ "author": "Lord14sol",
42
+ "license": "MIT",
43
+ "repository": {
44
+ "type": "git",
45
+ "url": "git+https://github.com/Lord14sol/solana-terminator-skill.git"
56
46
  }
57
47
  }
package/radar.js CHANGED
@@ -48,10 +48,10 @@ async function render() {
48
48
  console.log(green.bold(`
49
49
  ██████ ██████ ██ █████ ███ ██ █████ ██████ █████ ██████ █████ ██████
50
50
  ██ ██ ██ ██ ██ ██ ████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
51
- ██ ██ ██ ██ ███████ ██ ██ ██ ███████ ██████ ███████ ██ ██ ███████ ██████
52
- ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
53
- ██████ ██████ ███████ ██ ██ ██ ████ ██ ██ ██ ██ ██ ██ ██████ ██ ██ ██ ██
54
- v4.2.0 RADAR
51
+ █████ ██ ██ ██ ███████ ██ ██ ██ ███████ ██████ ███████ ██ ██ ███████ ██████
52
+ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
53
+ ██████ ██████ ███████ ██ ██ ██ ████ ██ ██ ██ ██ ██ ██ ██████ ██ ██ ██ ██
54
+ v4.2.7 RADAR
55
55
  `));
56
56
 
57
57
  line();