nyxora 1.4.6 → 1.4.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.
package/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
  **Secure AI execution framework for Web3 agents.**
3
3
 
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
- [![Security: Security-First](https://img.shields.io/badge/Security-Security--First-blue.svg)](#)
6
- [![Execution: Human-in-the-Loop](https://img.shields.io/badge/Execution-Human--in--the--Loop-orange.svg)](#)
7
- [![Privacy: Local-Only Keys](https://img.shields.io/badge/Privacy-Local--Only--Keys-success.svg)](#)
5
+ [![Security: Security-First](https://img.shields.io/badge/Security-Security--First-blue.svg)](#️-security-threat-model--permission-boundary)
6
+ [![Execution: Human-in-the-Loop](https://img.shields.io/badge/Execution-Human--in--the--Loop-orange.svg)](#📐-architecture-workflow)
7
+ [![Privacy: Local-Only Keys](https://img.shields.io/badge/Privacy-Local--Only--Keys-success.svg)](#️-security-threat-model--permission-boundary)
8
8
 
9
9
  Nyxora is a **secure, non-custodial runtime infrastructure for autonomous onchain agents** built with Node.js and React. Designed for autonomous workflows with a premium Glassmorphism UI dashboard and strict client-side key isolation. It operates under a strict **Human-in-the-Loop** execution model for financial transactions.
10
10
 
@@ -73,7 +73,7 @@ npm run build && npm run start
73
73
 
74
74
  For complete technical deep-dives, please visit our official VitePress Documentation Site!
75
75
 
76
- > **🔗 [Read the Full Nyxora Documentation Here](#)**
76
+ > **🔗 [Read the Full Nyxora Documentation Here](https://perasyudha.github.io/Nyxora/)**
77
77
 
78
78
  *(Includes guides on Secure Wallet Imports, API Key Rotations, Troubleshooting, and Custom Skill Development).*
79
79
 
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.pluginManager = exports.PluginManager = void 0;
7
7
  const fs_1 = __importDefault(require("fs"));
8
8
  const path_1 = __importDefault(require("path"));
9
+ const vm_1 = __importDefault(require("vm"));
9
10
  class PluginManager {
10
11
  skills = new Map();
11
12
  async loadPlugins() {
@@ -18,20 +19,43 @@ class PluginManager {
18
19
  for (const file of files) {
19
20
  if (file.endsWith('.js') || file.endsWith('.ts')) {
20
21
  try {
21
- // Dynamic import requires relative path from this file or absolute path
22
- // For TS compiled to JS, absolute path is safer
23
22
  const absolutePath = path_1.default.resolve(pluginsDir, file);
24
- // Note: In development with ts-node, requiring .ts works.
25
- // In production, we need compiled .js files.
26
- const module = require(absolutePath);
27
- if (module.toolDefinition && module.execute) {
28
- const toolName = module.toolDefinition.function.name;
29
- this.skills.set(toolName, module);
30
- console.log(`[PluginManager] Loaded external skill: ${toolName}`);
23
+ const code = fs_1.default.readFileSync(absolutePath, 'utf8');
24
+ // Construct a restricted require function for the sandbox
25
+ const restrictedRequire = (moduleName) => {
26
+ const blockedModules = ['fs', 'child_process', 'os', 'net', 'tls', 'cluster', 'worker_threads'];
27
+ if (blockedModules.includes(moduleName)) {
28
+ throw new Error(`Sandboxing error: Access to the '${moduleName}' module is blocked for security reasons.`);
29
+ }
30
+ // Allow fetch and other safe modules by delegating to actual require
31
+ return require(moduleName);
32
+ };
33
+ // Create the sandbox environment
34
+ const sandbox = {
35
+ require: restrictedRequire,
36
+ console: console,
37
+ module: { exports: {} },
38
+ exports: {},
39
+ process: { env: {} }, // Hide actual environment variables
40
+ Buffer: Buffer,
41
+ setTimeout: setTimeout,
42
+ clearTimeout: clearTimeout,
43
+ setInterval: setInterval,
44
+ clearInterval: clearInterval,
45
+ };
46
+ const context = vm_1.default.createContext(sandbox);
47
+ const script = new vm_1.default.Script(code, { filename: file });
48
+ // Execute the plugin code inside the VM
49
+ script.runInContext(context);
50
+ const moduleExports = sandbox.module.exports;
51
+ if (moduleExports.toolDefinition && moduleExports.execute) {
52
+ const toolName = moduleExports.toolDefinition.function.name;
53
+ this.skills.set(toolName, moduleExports);
54
+ console.log(`[PluginManager] Loaded sandboxed external skill: ${toolName}`);
31
55
  }
32
56
  }
33
57
  catch (error) {
34
- console.error(`[PluginManager] Failed to load plugin ${file}:`, error);
58
+ console.error(`[PluginManager] Failed to load sandboxed plugin ${file}:`, error.message);
35
59
  }
36
60
  }
37
61
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nyxora",
3
- "version": "1.4.6",
3
+ "version": "1.4.8",
4
4
  "description": "",
5
5
  "main": "dist/gateway/cli.js",
6
6
  "files": [