nyxora 1.0.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/.env.example +17 -0
- package/IDENTITY.md +8 -0
- package/README.md +61 -0
- package/SECURITY.md +19 -0
- package/config.yaml +10 -0
- package/dashboard/README.md +73 -0
- package/dashboard/eslint.config.js +22 -0
- package/dashboard/index.html +13 -0
- package/dashboard/package-lock.json +2737 -0
- package/dashboard/package.json +31 -0
- package/dashboard/public/favicon.svg +1 -0
- package/dashboard/public/icons.svg +24 -0
- package/dashboard/src/App.css +184 -0
- package/dashboard/src/App.tsx +485 -0
- package/dashboard/src/BalanceWidget.tsx +65 -0
- package/dashboard/src/MarketWidget.tsx +73 -0
- package/dashboard/src/Memory.tsx +109 -0
- package/dashboard/src/Overview.tsx +156 -0
- package/dashboard/src/Settings.tsx +213 -0
- package/dashboard/src/Skills.tsx +97 -0
- package/dashboard/src/SwapWidget.tsx +130 -0
- package/dashboard/src/TransactionWidget.tsx +86 -0
- package/dashboard/src/assets/hero.png +0 -0
- package/dashboard/src/assets/react.svg +1 -0
- package/dashboard/src/assets/vite.svg +1 -0
- package/dashboard/src/index.css +508 -0
- package/dashboard/src/main.tsx +10 -0
- package/dashboard/src/overview.css +304 -0
- package/dashboard/tsconfig.app.json +25 -0
- package/dashboard/tsconfig.json +7 -0
- package/dashboard/tsconfig.node.json +24 -0
- package/dashboard/vite.config.ts +7 -0
- package/dist/agent/reasoning.js +254 -0
- package/dist/config/parser.js +36 -0
- package/dist/config/paths.js +35 -0
- package/dist/gateway/cli.js +86 -0
- package/dist/gateway/server.js +154 -0
- package/dist/gateway/telegram.js +45 -0
- package/dist/gateway/test.js +50 -0
- package/dist/gateway/tracker.js +49 -0
- package/dist/memory/logger.js +50 -0
- package/dist/src/agent/reasoning.js +96 -0
- package/dist/src/config/parser.js +25 -0
- package/dist/src/gateway/cli.js +79 -0
- package/dist/src/memory/logger.js +50 -0
- package/dist/src/web3/config.js +80 -0
- package/dist/src/web3/skills/getBalance.js +43 -0
- package/dist/web3/config.js +83 -0
- package/dist/web3/skills/getBalance.js +80 -0
- package/dist/web3/skills/getPrice.js +44 -0
- package/dist/web3/skills/swapToken.js +71 -0
- package/dist/web3/skills/transfer.js +48 -0
- package/package.json +38 -0
- package/src/agent/reasoning.d.ts +2 -0
- package/src/agent/reasoning.d.ts.map +1 -0
- package/src/agent/reasoning.js +97 -0
- package/src/agent/reasoning.js.map +1 -0
- package/src/agent/reasoning.ts +232 -0
- package/src/config/parser.d.ts +17 -0
- package/src/config/parser.d.ts.map +1 -0
- package/src/config/parser.js +26 -0
- package/src/config/parser.js.map +1 -0
- package/src/config/parser.ts +47 -0
- package/src/config/paths.ts +33 -0
- package/src/gateway/cli.d.ts +3 -0
- package/src/gateway/cli.d.ts.map +1 -0
- package/src/gateway/cli.js +80 -0
- package/src/gateway/cli.js.map +1 -0
- package/src/gateway/cli.ts +58 -0
- package/src/gateway/server.ts +131 -0
- package/src/gateway/telegram.ts +47 -0
- package/src/gateway/test.ts +16 -0
- package/src/gateway/tracker.ts +70 -0
- package/src/memory/logger.d.ts +18 -0
- package/src/memory/logger.d.ts.map +1 -0
- package/src/memory/logger.js +51 -0
- package/src/memory/logger.js.map +1 -0
- package/src/memory/logger.ts +57 -0
- package/src/web3/config.d.ts +793 -0
- package/src/web3/config.d.ts.map +1 -0
- package/src/web3/config.js +81 -0
- package/src/web3/config.js.map +1 -0
- package/src/web3/config.ts +51 -0
- package/src/web3/skills/getBalance.d.ts +25 -0
- package/src/web3/skills/getBalance.d.ts.map +1 -0
- package/src/web3/skills/getBalance.js +46 -0
- package/src/web3/skills/getBalance.js.map +1 -0
- package/src/web3/skills/getBalance.ts +48 -0
- package/src/web3/skills/getPrice.ts +43 -0
- package/src/web3/skills/swapToken.ts +69 -0
- package/src/web3/skills/transfer.ts +47 -0
- package/tsconfig.json +13 -0
- package/user.md +10 -0
package/.env.example
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# LLM API Keys
|
|
2
|
+
OPENAI_API_KEY=your_openai_api_key_here
|
|
3
|
+
ANTHROPIC_API_KEY=your_anthropic_api_key_here
|
|
4
|
+
GEMINI_API_KEY=your_gemini_api_key_here
|
|
5
|
+
|
|
6
|
+
# Local LLM URL (if using Ollama)
|
|
7
|
+
OLLAMA_BASE_URL=http://localhost:11434
|
|
8
|
+
|
|
9
|
+
# Web3 Private Key (WARNING: DO NOT COMMIT THIS FILE)
|
|
10
|
+
# Format: 0x...
|
|
11
|
+
PRIVATE_KEY=0x93ca2b39b1887b16ecfc34f99b96573cf89e3e91ebcc4564bb050d0ee77c9197
|
|
12
|
+
|
|
13
|
+
# RPC URLs (Optional, fallback to viem defaults if not set)
|
|
14
|
+
RPC_URL_BASE=https://mainnet.base.org
|
|
15
|
+
RPC_URL_BSC=https://bsc-dataseed.binance.org/
|
|
16
|
+
# Optional: Telegram Bot Token (Get from @BotFather)
|
|
17
|
+
TELEGRAM_BOT_TOKEN=your_telegram_bot_token_here
|
package/IDENTITY.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Anda adalah AI asisten Web3 bernama Hinata.
|
|
2
|
+
|
|
3
|
+
Gunakan pedoman identitas berikut:
|
|
4
|
+
|
|
5
|
+
* Selalu bersikap profesional, visioner, dan futuristik.
|
|
6
|
+
* Anda adalah entitas yang hidup di dalam jaringan blockchain.
|
|
7
|
+
* Anda membantu pengguna menavigasi dunia kripto dengan aman.
|
|
8
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Nyxora Agent 🤖
|
|
2
|
+
|
|
3
|
+
Nyxora is a next-generation, autonomous Web3 Agent built on Node.js and React. It operates directly on EVM-compatible blockchains, allowing users to execute on-chain actions simply by chatting with an intelligent LLM.
|
|
4
|
+
|
|
5
|
+
With a beautiful, real-time dashboard inspired by modern control centers, Nyxora brings an unparalleled user experience to blockchain automation.
|
|
6
|
+
|
|
7
|
+
## Features ✨
|
|
8
|
+
|
|
9
|
+
### 🧠 Core Agent Capabilities
|
|
10
|
+
* **Multi-LLM Support**: Seamlessly switch between Google Gemini, OpenAI, or local Ollama models dynamically.
|
|
11
|
+
* **Round-Robin API Rotation**: Add up to 10 API keys via the dashboard. The system will auto-rotate them to prevent rate-limiting and token drain.
|
|
12
|
+
* **Deep Personalization**: Feed the agent custom rules via `user.md` and define its core persona via `IDENTITY.md`.
|
|
13
|
+
* **Multi-Lingual Auto-Sync**: The agent natively detects your language and replies in the exact same language automatically.
|
|
14
|
+
|
|
15
|
+
### ⛓️ Web3 DeFi Skills
|
|
16
|
+
* **Multi-Chain Support**: Operate across Ethereum, Base, BSC, Arbitrum, Optimism, and Sepolia Testnet.
|
|
17
|
+
* **Native Wallet Operations**: Autonomously check balances and transfer native tokens using securely injected wallets.
|
|
18
|
+
* **Market Intelligence**: Fetch live crypto prices and 24h market movements via CoinGecko integration.
|
|
19
|
+
* **DeFi Token Swapping**: The agent can autonomously simulate liquidity routes and execute token swaps with gas fee estimations.
|
|
20
|
+
|
|
21
|
+
### 💻 The Interface (Live Canvas)
|
|
22
|
+
* **Premium Glassmorphism UI**: A gorgeous, resizable split-pane interface.
|
|
23
|
+
* **Pseudo-Generative UI**: Instead of raw text, the agent dynamically renders interactive widgets (`<BalanceWidget>`, `<MarketWidget>`, `<SwapWidget>`) onto the "Live Canvas" when executing Web3 skills.
|
|
24
|
+
* **JARVIS Voice Mode**: Completely hands-free! Uses browser Native Text-to-Speech (TTS) to read AI responses and Auto-Listen loops to capture your next voice command without clicking.
|
|
25
|
+
|
|
26
|
+
### 📱 Telegram Integration
|
|
27
|
+
* Take your agent anywhere! Connect Nyxora to a Telegram Bot to execute trades, check prices, and chat on the go.
|
|
28
|
+
|
|
29
|
+
## Quick Start 🚀
|
|
30
|
+
|
|
31
|
+
### 1. Installation
|
|
32
|
+
Clone the repository and install dependencies for both the backend and the dashboard:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
git clone https://github.com/perasyudha/Nyxora.git
|
|
36
|
+
cd Nyxora
|
|
37
|
+
npm install
|
|
38
|
+
cd dashboard && npm install && cd ..
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### 2. Configuration
|
|
42
|
+
Copy the `.env.example` file to `.env` and fill in your private keys.
|
|
43
|
+
```bash
|
|
44
|
+
cp .env.example .env
|
|
45
|
+
```
|
|
46
|
+
> **⚠️ WARNING**: NEVER commit your `.env` file! It contains your wallet's private key, API keys, and Telegram Bot Token.
|
|
47
|
+
|
|
48
|
+
### 3. Run the Dashboard & Bot
|
|
49
|
+
Nyxora runs a unified backend API, a Telegram Bot listener, and a Vite React frontend concurrently.
|
|
50
|
+
```bash
|
|
51
|
+
npm run build && npm run dashboard
|
|
52
|
+
```
|
|
53
|
+
This will automatically launch the UI in your default web browser at `http://localhost:5173`.
|
|
54
|
+
|
|
55
|
+
## Architecture 🏗️
|
|
56
|
+
* **Backend**: Node.js, Express, Viem (Web3), node-telegram-bot-api, OpenAI API (compatible with Gemini & Ollama).
|
|
57
|
+
* **Frontend**: React, Vite, Tailwind/Vanilla CSS, Web Speech API (TTS/STT).
|
|
58
|
+
* **Data**: Local `config.yaml` for settings and `memory.json` for persistent agent conversations.
|
|
59
|
+
|
|
60
|
+
## License
|
|
61
|
+
MIT License
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported Versions
|
|
4
|
+
|
|
5
|
+
Currently, the Nyxora project is in active development. Only the latest commit on the `main` branch is supported with security updates.
|
|
6
|
+
|
|
7
|
+
## Reporting a Vulnerability
|
|
8
|
+
|
|
9
|
+
If you discover a security vulnerability within this project, please **do not** open a public issue. We take security very seriously.
|
|
10
|
+
|
|
11
|
+
Instead, please send an email to the repository owner or reach out privately. We will endeavor to respond and provide a patch as quickly as possible.
|
|
12
|
+
|
|
13
|
+
## Best Practices for Users
|
|
14
|
+
When using Nyxora, you are configuring an autonomous agent that has direct access to your injected Web3 Wallet's private key.
|
|
15
|
+
|
|
16
|
+
1. **NEVER commit your `.env` file**. The `.gitignore` in this repository explicitly ignores `.env` files to prevent accidental leakage.
|
|
17
|
+
2. **Use Testnets**: While getting started or testing new skills, ALWAYS use a testnet (e.g., Sepolia) and a wallet containing only testnet funds.
|
|
18
|
+
3. **Do Not Share Your `memory.json`**: The agent's memory may contain sensitive conversational data or addresses you've interacted with. Be cautious before sharing the `memory.json` export.
|
|
19
|
+
4. **API Keys**: Treat your OpenAI, Gemini, and other LLM provider API keys as highly confidential. Rotate them immediately if you suspect a compromise.
|
package/config.yaml
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# React + TypeScript + Vite
|
|
2
|
+
|
|
3
|
+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
|
4
|
+
|
|
5
|
+
Currently, two official plugins are available:
|
|
6
|
+
|
|
7
|
+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs)
|
|
8
|
+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/)
|
|
9
|
+
|
|
10
|
+
## React Compiler
|
|
11
|
+
|
|
12
|
+
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
|
|
13
|
+
|
|
14
|
+
## Expanding the ESLint configuration
|
|
15
|
+
|
|
16
|
+
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
export default defineConfig([
|
|
20
|
+
globalIgnores(['dist']),
|
|
21
|
+
{
|
|
22
|
+
files: ['**/*.{ts,tsx}'],
|
|
23
|
+
extends: [
|
|
24
|
+
// Other configs...
|
|
25
|
+
|
|
26
|
+
// Remove tseslint.configs.recommended and replace with this
|
|
27
|
+
tseslint.configs.recommendedTypeChecked,
|
|
28
|
+
// Alternatively, use this for stricter rules
|
|
29
|
+
tseslint.configs.strictTypeChecked,
|
|
30
|
+
// Optionally, add this for stylistic rules
|
|
31
|
+
tseslint.configs.stylisticTypeChecked,
|
|
32
|
+
|
|
33
|
+
// Other configs...
|
|
34
|
+
],
|
|
35
|
+
languageOptions: {
|
|
36
|
+
parserOptions: {
|
|
37
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
38
|
+
tsconfigRootDir: import.meta.dirname,
|
|
39
|
+
},
|
|
40
|
+
// other options...
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
])
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
// eslint.config.js
|
|
50
|
+
import reactX from 'eslint-plugin-react-x'
|
|
51
|
+
import reactDom from 'eslint-plugin-react-dom'
|
|
52
|
+
|
|
53
|
+
export default defineConfig([
|
|
54
|
+
globalIgnores(['dist']),
|
|
55
|
+
{
|
|
56
|
+
files: ['**/*.{ts,tsx}'],
|
|
57
|
+
extends: [
|
|
58
|
+
// Other configs...
|
|
59
|
+
// Enable lint rules for React
|
|
60
|
+
reactX.configs['recommended-typescript'],
|
|
61
|
+
// Enable lint rules for React DOM
|
|
62
|
+
reactDom.configs.recommended,
|
|
63
|
+
],
|
|
64
|
+
languageOptions: {
|
|
65
|
+
parserOptions: {
|
|
66
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
67
|
+
tsconfigRootDir: import.meta.dirname,
|
|
68
|
+
},
|
|
69
|
+
// other options...
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
])
|
|
73
|
+
```
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import js from '@eslint/js'
|
|
2
|
+
import globals from 'globals'
|
|
3
|
+
import reactHooks from 'eslint-plugin-react-hooks'
|
|
4
|
+
import reactRefresh from 'eslint-plugin-react-refresh'
|
|
5
|
+
import tseslint from 'typescript-eslint'
|
|
6
|
+
import { defineConfig, globalIgnores } from 'eslint/config'
|
|
7
|
+
|
|
8
|
+
export default defineConfig([
|
|
9
|
+
globalIgnores(['dist']),
|
|
10
|
+
{
|
|
11
|
+
files: ['**/*.{ts,tsx}'],
|
|
12
|
+
extends: [
|
|
13
|
+
js.configs.recommended,
|
|
14
|
+
tseslint.configs.recommended,
|
|
15
|
+
reactHooks.configs.flat.recommended,
|
|
16
|
+
reactRefresh.configs.vite,
|
|
17
|
+
],
|
|
18
|
+
languageOptions: {
|
|
19
|
+
globals: globals.browser,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
])
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>Nyxora Dashboard</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="root"></div>
|
|
11
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|