nyxora 1.5.4 → 1.5.5

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 (45) hide show
  1. package/README.md +12 -7
  2. package/package.json +3 -2
  3. package/packages/core/package.json +1 -1
  4. package/packages/dashboard/package-lock.json +2 -2
  5. package/packages/dashboard/package.json +1 -1
  6. package/packages/policy/package.json +1 -1
  7. package/packages/signer/package.json +1 -1
  8. package/dist/agent/limitOrderManager.js +0 -177
  9. package/dist/agent/reasoning.js +0 -452
  10. package/dist/agent/transactionManager.js +0 -38
  11. package/dist/agent/updateProfile.js +0 -52
  12. package/dist/config/parser.js +0 -50
  13. package/dist/config/paths.js +0 -35
  14. package/dist/gateway/cli.js +0 -93
  15. package/dist/gateway/server.js +0 -215
  16. package/dist/gateway/setup.js +0 -246
  17. package/dist/gateway/telegram.js +0 -149
  18. package/dist/gateway/test.js +0 -15
  19. package/dist/gateway/tracker.js +0 -49
  20. package/dist/memory/logger.js +0 -109
  21. package/dist/system/pluginManager.js +0 -80
  22. package/dist/system/skills/browseWeb.js +0 -50
  23. package/dist/system/skills/executeShell.js +0 -38
  24. package/dist/system/skills/installSkill.js +0 -51
  25. package/dist/system/skills/readFile.js +0 -39
  26. package/dist/system/skills/updateSecurityPolicy.js +0 -60
  27. package/dist/system/skills/writeFile.js +0 -44
  28. package/dist/utils/crypto.js +0 -35
  29. package/dist/utils/formatter.js +0 -30
  30. package/dist/utils/state.js +0 -30
  31. package/dist/web3/config.js +0 -50
  32. package/dist/web3/skills/bridgeToken.js +0 -216
  33. package/dist/web3/skills/checkAddress.js +0 -52
  34. package/dist/web3/skills/checkPortfolio.js +0 -154
  35. package/dist/web3/skills/checkSecurity.js +0 -67
  36. package/dist/web3/skills/createWallet.js +0 -34
  37. package/dist/web3/skills/customTx.js +0 -93
  38. package/dist/web3/skills/getBalance.js +0 -117
  39. package/dist/web3/skills/getMyAddress.js +0 -29
  40. package/dist/web3/skills/getPrice.js +0 -44
  41. package/dist/web3/skills/marketAnalysis.js +0 -71
  42. package/dist/web3/skills/mintNft.js +0 -122
  43. package/dist/web3/skills/swapToken.js +0 -217
  44. package/dist/web3/skills/transfer.js +0 -131
  45. package/dist/web3/utils/tokens.js +0 -110
package/README.md CHANGED
@@ -1,13 +1,13 @@
1
1
  # Nyxora Agent 🤖
2
2
  **Production-Grade Secure AI Execution Framework for Web3 Agents.**
3
3
 
4
- [![Version](https://img.shields.io/badge/version-1.5.4-blue.svg)](https://github.com/perasyudha/Nyxora)
4
+ [![Version](https://img.shields.io/badge/version-1.5.5-blue.svg)](https://github.com/perasyudha/Nyxora)
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
6
  [![Security: Production-Grade](https://img.shields.io/badge/Security-Production--Grade-blue.svg)](#️-advanced-security-threat-model)
7
7
  [![Execution: Cryptographic Approval](https://img.shields.io/badge/Execution-Cryptographic--Approval-orange.svg)](#️-advanced-security-threat-model)
8
8
  [![Privacy: Local-Only Keys](https://img.shields.io/badge/Privacy-Local--Only--Keys-success.svg)](#️-advanced-security-threat-model)
9
9
 
10
- Nyxora (v1.5.4) is a **secure, non-custodial runtime infrastructure for autonomous onchain agents** built with a robust Monorepo architecture (Node.js & React). Designed for autonomous workflows with a premium Glassmorphism UI dashboard and strict client-side key isolation.
10
+ Nyxora (v1.5.5) is a **secure, non-custodial runtime infrastructure for autonomous onchain agents** built with a robust Monorepo architecture (Node.js & React). Designed for autonomous workflows with a premium Glassmorphism UI dashboard and strict client-side key isolation.
11
11
 
12
12
  It operates under an institutional-grade **Cryptographically Bound Human-in-the-Loop** execution model, ensuring that Remote AIs (LLMs) never have unilateral access to your funds.
13
13
 
@@ -15,7 +15,7 @@ It operates under an institutional-grade **Cryptographically Bound Human-in-the-
15
15
 
16
16
  ## 🔥 Key Features
17
17
 
18
- ### Advanced Security Architecture (v1.5.4)
18
+ ### Advanced Security Architecture (v1.5.5)
19
19
  * **3-Tier IPC Architecture**: Nyxora is split into isolated processes: **Core** (LLM Runtime), **Policy Engine** (Guardrails on port 3001), and **Signer Vault** (Isolated Key Manager on Unix Sockets).
20
20
  * **Cryptographically Bound Approval**: Policy changes and transactions requested by the AI are drafted as hashes (`sha256`). Approval via the UI requires a challenge nonce, preventing Man-in-the-Middle (MITM) attacks.
21
21
  * **Immutable Policy Guardrails**: Transaction limits (e.g. `max_usd_per_tx`) are strictly enforced by the Policy Engine. The LLM has zero write-access to bypass these rules.
@@ -57,17 +57,22 @@ To dive deeper into the technical details of our Zero-Knowledge security archite
57
57
  ## 🚀 Quick Start & Installation
58
58
 
59
59
  ### Local Development & Execution
60
- With the new v1.5.4 Monorepo architecture, launching Nyxora is completely automated via the internal `launcher.ts` orchestrator.
60
+ With the new v1.5.5 Monorepo architecture, launching Nyxora is completely automated via the internal `launcher.ts` orchestrator.
61
61
 
62
62
  ```bash
63
63
  git clone https://github.com/perasyudha/Nyxora.git
64
64
  cd Nyxora
65
+
66
+ # 1. Install Dependencies
65
67
  npm install
66
68
 
67
- # Build all monorepo packages (Core, Policy, Signer, Dashboard)
68
- npm run build --workspaces
69
+ # 2. Build the Dashboard UI
70
+ npm run build
71
+
72
+ # 3. Interactive Setup Wizard (API Keys, Wallet, Model Selection)
73
+ npm run setup
69
74
 
70
- # Start the Nyxora Orchestrator
75
+ # 4. Start the Nyxora Orchestrator
71
76
  npm start
72
77
  ```
73
78
  *`npm start` will automatically boot the Core, Policy Engine, Signer Vault, and Local Dashboard UI.*
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "nyxora",
3
- "version": "1.5.4",
3
+ "version": "1.5.5",
4
4
  "workspaces": [
5
5
  "packages/*"
6
6
  ],
7
7
  "scripts": {
8
8
  "start": "ts-node -T launcher.ts",
9
- "build": "npm run build --workspaces",
9
+ "build": "npm run build --workspace=dashboard",
10
+ "setup": "ts-node -T packages/core/src/gateway/cli.ts setup",
10
11
  "test": "echo \"Error: no test specified\" && exit 1"
11
12
  },
12
13
  "dependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nyxora/core",
3
- "version": "1.5.4",
3
+ "version": "1.5.5",
4
4
  "private": true,
5
5
  "main": "src/gateway/server.ts",
6
6
  "dependencies": {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "dashboard",
3
- "version": "0.0.0",
3
+ "version": "1.5.4",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "dashboard",
9
- "version": "0.0.0",
9
+ "version": "1.5.4",
10
10
  "dependencies": {
11
11
  "lucide-react": "^1.16.0",
12
12
  "react": "^19.2.6",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dashboard",
3
3
  "private": true,
4
- "version": "1.5.4",
4
+ "version": "1.5.5",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nyxora/policy",
3
- "version": "1.5.4",
3
+ "version": "1.5.5",
4
4
  "private": true,
5
5
  "main": "src/server.ts",
6
6
  "dependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nyxora/signer",
3
- "version": "1.5.4",
3
+ "version": "1.5.5",
4
4
  "private": true,
5
5
  "main": "src/server.ts",
6
6
  "dependencies": {
@@ -1,177 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.cancelLimitOrderToolDefinition = exports.listLimitOrdersToolDefinition = exports.createLimitOrderToolDefinition = exports.limitOrderManager = exports.LimitOrderManager = void 0;
7
- const fs_1 = __importDefault(require("fs"));
8
- const parser_1 = require("../config/parser");
9
- const paths_1 = require("../config/paths");
10
- const tokens_1 = require("../web3/utils/tokens");
11
- const swapToken_1 = require("../web3/skills/swapToken");
12
- const transactionManager_1 = require("./transactionManager");
13
- const reasoning_1 = require("./reasoning");
14
- class LimitOrderManager {
15
- filePath;
16
- orders = [];
17
- monitorInterval = null;
18
- constructor() {
19
- const config = (0, parser_1.loadConfig)();
20
- this.filePath = (0, paths_1.getPath)(config.memory?.path ? config.memory.path.replace('memory.json', 'orders.json') : 'orders.json');
21
- this.loadOrders();
22
- }
23
- loadOrders() {
24
- if (fs_1.default.existsSync(this.filePath)) {
25
- try {
26
- const data = fs_1.default.readFileSync(this.filePath, 'utf-8');
27
- this.orders = JSON.parse(data);
28
- }
29
- catch (error) {
30
- this.orders = [];
31
- }
32
- }
33
- }
34
- saveOrders() {
35
- try {
36
- fs_1.default.writeFileSync(this.filePath, JSON.stringify(this.orders, null, 2));
37
- }
38
- catch (error) { }
39
- }
40
- createOrder(chainName, fromToken, toToken, amountStr, targetPriceUsd, condition) {
41
- const id = `order_${Date.now()}_${Math.random().toString(36).substr(2, 5)}`;
42
- const order = {
43
- id, chainName, fromToken, toToken, amountStr, targetPriceUsd, condition, status: 'pending', createdAt: Date.now()
44
- };
45
- this.orders.push(order);
46
- this.saveOrders();
47
- return `Limit order created successfully. ID: ${id}. The system will monitor ${fromToken} price on ${chainName} and execute the swap to ${toToken} when price is ${condition} $${targetPriceUsd}.`;
48
- }
49
- listOrders() {
50
- const pending = this.orders.filter(o => o.status === 'pending');
51
- if (pending.length === 0)
52
- return "No active limit orders.";
53
- let report = "Active Limit Orders:\n";
54
- pending.forEach(o => {
55
- report += `- [${o.id}] Swap ${o.amountStr} ${o.fromToken} -> ${o.toToken} on ${o.chainName} when ${o.fromToken} is ${o.condition} $${o.targetPriceUsd}\n`;
56
- });
57
- return report;
58
- }
59
- cancelOrder(id) {
60
- const order = this.orders.find(o => o.id === id);
61
- if (!order)
62
- return `Order ${id} not found.`;
63
- if (order.status !== 'pending')
64
- return `Order ${id} cannot be cancelled because it is ${order.status}.`;
65
- order.status = 'cancelled';
66
- this.saveOrders();
67
- return `Order ${id} cancelled successfully.`;
68
- }
69
- startMonitor() {
70
- if (this.monitorInterval)
71
- clearInterval(this.monitorInterval);
72
- // Monitor every 60 seconds
73
- this.monitorInterval = setInterval(() => this.checkOrders(), 60000);
74
- console.log('[LimitOrderManager] Order monitoring started (interval: 60s)');
75
- }
76
- async checkOrders() {
77
- const pending = this.orders.filter(o => o.status === 'pending');
78
- if (pending.length === 0)
79
- return;
80
- for (const order of pending) {
81
- try {
82
- let tokenAddress = (0, tokens_1.resolveToken)(order.fromToken, order.chainName);
83
- if (tokenAddress === "0x0000000000000000000000000000000000000000") {
84
- tokenAddress = (0, tokens_1.resolveToken)("W" + order.fromToken, order.chainName);
85
- }
86
- const res = await fetch(`https://api.dexscreener.com/latest/dex/tokens/${tokenAddress}`);
87
- if (!res.ok)
88
- continue;
89
- const data = await res.json();
90
- if (!data.pairs || data.pairs.length === 0)
91
- continue;
92
- let pair = data.pairs.find((p) => p.chainId === order.chainName) || data.pairs[0];
93
- const currentPrice = parseFloat(pair.priceUsd);
94
- let shouldExecute = false;
95
- if (order.condition === 'above' && currentPrice >= order.targetPriceUsd)
96
- shouldExecute = true;
97
- if (order.condition === 'below' && currentPrice <= order.targetPriceUsd)
98
- shouldExecute = true;
99
- if (shouldExecute) {
100
- console.log(`[LimitOrderManager] Condition met for order ${order.id}. Current price $${currentPrice} is ${order.condition} $${order.targetPriceUsd}. Executing...`);
101
- // 1. Prepare Swap
102
- const prepareResult = await (0, swapToken_1.prepareSwapToken)(order.chainName, order.fromToken, order.toToken, order.amountStr, 'auto');
103
- // 2. Extract Tx ID
104
- const txMatch = prepareResult.match(/Transaction ID: ([\w-]+)\./);
105
- if (!txMatch) {
106
- order.status = 'failed';
107
- this.saveOrders();
108
- (0, reasoning_1.processUserInput)(`Limit order ${order.id} execution failed during preparation. Output: ${prepareResult}`, 'system').catch(() => { });
109
- continue;
110
- }
111
- const txId = txMatch[1];
112
- const tx = transactionManager_1.txManager.getTransaction(txId);
113
- if (!tx)
114
- throw new Error("Transaction not found in manager");
115
- // 3. Execute Swap automatically
116
- const executeResult = await (0, swapToken_1.executeSwap)(order.chainName, tx.details);
117
- if (executeResult.includes('successful')) {
118
- transactionManager_1.txManager.updateStatus(txId, 'executed', executeResult);
119
- order.status = 'executed';
120
- this.saveOrders();
121
- (0, reasoning_1.processUserInput)(`Limit order ${order.id} just EXECUTED automatically! Price hit $${currentPrice}. Swap result: ${executeResult}. Please notify the user immediately!`, 'system').catch(() => { });
122
- }
123
- else {
124
- transactionManager_1.txManager.updateStatus(txId, 'failed', executeResult);
125
- order.status = 'failed';
126
- this.saveOrders();
127
- (0, reasoning_1.processUserInput)(`Limit order ${order.id} FAILED to execute. Price hit $${currentPrice} but execution failed: ${executeResult}. Please notify the user.`, 'system').catch(() => { });
128
- }
129
- }
130
- }
131
- catch (error) {
132
- console.error(`[LimitOrderManager] Error checking order ${order.id}:`, error.message);
133
- }
134
- }
135
- }
136
- }
137
- exports.LimitOrderManager = LimitOrderManager;
138
- exports.limitOrderManager = new LimitOrderManager();
139
- exports.createLimitOrderToolDefinition = {
140
- type: "function",
141
- function: {
142
- name: "create_limit_order",
143
- description: "Creates an automatic cut-loss or take-profit limit order. The system will automatically execute the swap when the price condition is met.",
144
- parameters: {
145
- type: "object",
146
- properties: {
147
- chainName: { type: "string", enum: ["ethereum", "base", "bsc", "arbitrum", "optimism", "sepolia"] },
148
- fromToken: { type: "string", description: "Token to sell" },
149
- toToken: { type: "string", description: "Token to buy" },
150
- amountStr: { type: "string", description: "Amount to sell" },
151
- targetPriceUsd: { type: "number", description: "Target price in USD for the fromToken" },
152
- condition: { type: "string", enum: ["above", "below"], description: "Trigger when price goes above (take-profit) or below (cut-loss) target" }
153
- },
154
- required: ["chainName", "fromToken", "toToken", "amountStr", "targetPriceUsd", "condition"],
155
- },
156
- },
157
- };
158
- exports.listLimitOrdersToolDefinition = {
159
- type: "function",
160
- function: {
161
- name: "list_limit_orders",
162
- description: "Lists all active automated limit orders.",
163
- parameters: { type: "object", properties: {}, required: [] },
164
- },
165
- };
166
- exports.cancelLimitOrderToolDefinition = {
167
- type: "function",
168
- function: {
169
- name: "cancel_limit_order",
170
- description: "Cancels an active limit order by ID.",
171
- parameters: {
172
- type: "object",
173
- properties: { id: { type: "string" } },
174
- required: ["id"],
175
- },
176
- },
177
- };