nyxora 1.7.1 → 1.7.2
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/.dockerignore +12 -0
- package/CHANGELOG.md +5 -0
- package/DOCKER.md +68 -0
- package/Dockerfile +43 -0
- package/package.json +1 -1
- package/packages/core/package.json +1 -1
- package/packages/core/src/config/parser.ts +6 -2
- package/packages/core/src/gateway/googleAuthModule.ts +19 -0
- package/packages/core/src/gateway/server.ts +9 -3
- package/packages/dashboard/dist/assets/{index-Dc3Tu0Te.js → index-cGPka4s1.js} +13 -13
- package/packages/dashboard/dist/index.html +1 -1
- package/packages/dashboard/package.json +1 -1
- package/packages/mcp-server/package.json +2 -2
- package/packages/policy/package.json +2 -2
- package/packages/policy/src/server.ts +2 -2
- package/packages/signer/package.json +2 -2
package/.dockerignore
ADDED
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.7.2] - Unreleased
|
|
9
|
+
|
|
10
|
+
### UI/UX Enhancements
|
|
11
|
+
- **Google Workspace Logout**: Users can now easily disconnect their Google Workspace accounts directly from the Dashboard (OS Skills tab). This triggers a secure token purge from both the OS Keyring and local storage, ensuring privacy and seamless account switching.
|
|
12
|
+
|
|
8
13
|
## [1.7.1]
|
|
9
14
|
|
|
10
15
|
### CLI Enhancements
|
package/DOCKER.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# 🐳 Nyxora Docker Guide
|
|
2
|
+
|
|
3
|
+
This document provides a comprehensive guide to installing, configuring interactively, and running the Nyxora Agent fully containerized via Docker. This approach ensures Nyxora can run seamlessly across different environments (Linux, macOS, Windows) without requiring a local Node.js installation.
|
|
4
|
+
|
|
5
|
+
## 🛠 1. Get the Docker Image
|
|
6
|
+
|
|
7
|
+
You have two options to obtain the Nyxora Docker image:
|
|
8
|
+
|
|
9
|
+
### Option A: Pull Pre-built Image (Recommended & Fastest)
|
|
10
|
+
Nyxora officially publishes Docker images via GitHub Container Registry (GHCR) upon every release.
|
|
11
|
+
```bash
|
|
12
|
+
docker pull ghcr.io/nyxoraai/nyxora:latest
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Option B: Build Locally
|
|
16
|
+
If you are developing or prefer to compile it yourself, run this in the root directory:
|
|
17
|
+
```bash
|
|
18
|
+
docker build -t ghcr.io/nyxoraai/nyxora:latest .
|
|
19
|
+
```
|
|
20
|
+
> **Note:** The initial build takes time as it compiles C++/Rust system modules (`isolated-vm`, `libsecret`).
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## ⚙️ 2. Interactive Setup (Secure & Isolated)
|
|
25
|
+
Nyxora requires an initial configuration (API Keys, Web3 Wallet, etc.). Run the command below to launch the **Interactive Setup Wizard** securely inside Docker.
|
|
26
|
+
|
|
27
|
+
This command mounts a volume and saves your configurations safely to a `.nyxora_docker` folder in your computer's Home directory, ensuring your existing local Nyxora installation remains untouched.
|
|
28
|
+
```bash
|
|
29
|
+
docker run -it --rm -v ~/.nyxora_docker:/root/.nyxora ghcr.io/nyxoraai/nyxora:latest npx ts-node -T packages/core/src/gateway/setup-cli.ts
|
|
30
|
+
```
|
|
31
|
+
*Complete the setup by answering the prompts in your terminal. Once you see "Setup Successful!", this temporary container will automatically delete itself.*
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 🚀 3. Start Nyxora (Background Daemon)
|
|
36
|
+
Now that the setup is complete, it's time to start the main architecture (Core API, Policy Engine, and Signer Vault) as a non-stop background daemon:
|
|
37
|
+
```bash
|
|
38
|
+
docker run -d --name nyxora-daemon -p 3000:3000 -p 3001:3001 -v ~/.nyxora_docker:/root/.nyxora ghcr.io/nyxoraai/nyxora:latest
|
|
39
|
+
```
|
|
40
|
+
*(This command will output a long container ID indicating that the daemon is successfully running).*
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## 🔑 4. Retrieve the Auth Token
|
|
45
|
+
For security reasons, the Web Dashboard is locked behind a randomly generated runtime token upon every boot. Retrieve this token from the Docker logs:
|
|
46
|
+
```bash
|
|
47
|
+
docker logs nyxora-daemon
|
|
48
|
+
```
|
|
49
|
+
Look for a line that says: `[Launcher] Generated Internal Auth Token: <LONG_TOKEN_CODE>`. Please copy that token code.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## 💻 5. Access the Web Dashboard
|
|
54
|
+
Open your preferred web browser, and access the following URL (replace `<LONG_TOKEN_CODE>` with the token you copied in Step 4):
|
|
55
|
+
```text
|
|
56
|
+
http://localhost:3000/?token=<LONG_TOKEN_CODE>
|
|
57
|
+
```
|
|
58
|
+
Congratulations! Your Nyxora Agent is now fully operational.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## 🧰 Docker Management Reference
|
|
63
|
+
Here are some useful commands for managing your Nyxora daemon in the future:
|
|
64
|
+
|
|
65
|
+
* **Stop Nyxora:** `docker stop nyxora-daemon`
|
|
66
|
+
* **Start Nyxora again:** `docker start nyxora-daemon`
|
|
67
|
+
* **Monitor real-time AI logs:** `docker logs -f nyxora-daemon` (Press `Ctrl+C` to exit the stream).
|
|
68
|
+
* **Remove the container (e.g., to reset or upgrade):** `docker rm -f nyxora-daemon`
|
package/Dockerfile
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
FROM node:22-bookworm-slim
|
|
2
|
+
|
|
3
|
+
# Set working directory
|
|
4
|
+
WORKDIR /app
|
|
5
|
+
|
|
6
|
+
# Set Production Environment
|
|
7
|
+
# Install native dependencies required for isolated-vm, keyring, etc.
|
|
8
|
+
RUN apt-get update && apt-get install -y \
|
|
9
|
+
python3 \
|
|
10
|
+
make \
|
|
11
|
+
g++ \
|
|
12
|
+
libsecret-1-dev \
|
|
13
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
14
|
+
|
|
15
|
+
# Copy package metadata first to leverage Docker caching
|
|
16
|
+
COPY package*.json ./
|
|
17
|
+
COPY packages/core/package*.json ./packages/core/
|
|
18
|
+
COPY packages/dashboard/package*.json ./packages/dashboard/
|
|
19
|
+
COPY packages/mcp-server/package*.json ./packages/mcp-server/
|
|
20
|
+
COPY packages/policy/package*.json ./packages/policy/
|
|
21
|
+
COPY packages/signer/package*.json ./packages/signer/
|
|
22
|
+
|
|
23
|
+
# Install dependencies
|
|
24
|
+
RUN npm install
|
|
25
|
+
|
|
26
|
+
# Copy the rest of the application code
|
|
27
|
+
COPY . .
|
|
28
|
+
|
|
29
|
+
# Build the dashboard (frontend)
|
|
30
|
+
RUN npm run build --workspace=dashboard
|
|
31
|
+
|
|
32
|
+
# Set Production Environment now that build is done
|
|
33
|
+
ENV NODE_ENV=production
|
|
34
|
+
|
|
35
|
+
# Expose the ports used by Core/Dashboard and Policy Engine
|
|
36
|
+
EXPOSE 3000
|
|
37
|
+
EXPOSE 3001
|
|
38
|
+
|
|
39
|
+
# PERSISTENT STORAGE: Protect Nyxora's memory and configuration
|
|
40
|
+
VOLUME ["/root/.nyxora"]
|
|
41
|
+
|
|
42
|
+
# Start the daemon in the foreground
|
|
43
|
+
CMD ["npx", "ts-node", "-T", "launcher.ts"]
|
package/package.json
CHANGED
|
@@ -158,8 +158,12 @@ export function loadConfig(): NyxoraConfig {
|
|
|
158
158
|
system: { allow_shell_execution: false, allow_file_write: false }
|
|
159
159
|
}
|
|
160
160
|
} as NyxoraConfig;
|
|
161
|
-
} catch (error) {
|
|
162
|
-
|
|
161
|
+
} catch (error: any) {
|
|
162
|
+
if (error.code === 'ENOENT') {
|
|
163
|
+
console.log('[Config] No config.yaml found. Using default configuration.');
|
|
164
|
+
} else {
|
|
165
|
+
console.error('[Config] Failed to load config.yaml. Using default configuration.', error);
|
|
166
|
+
}
|
|
163
167
|
return {
|
|
164
168
|
agent: { name: 'Nyxora-Default', default_chain: 'base' },
|
|
165
169
|
llm: {
|
|
@@ -145,6 +145,25 @@ export async function getAccessToken(): Promise<string | null> {
|
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
+
export async function logoutGoogle(): Promise<boolean> {
|
|
149
|
+
try {
|
|
150
|
+
const { Entry } = require('@napi-rs/keyring');
|
|
151
|
+
const entry = new Entry('nyxora', 'google_refresh_token');
|
|
152
|
+
await entry.deletePassword();
|
|
153
|
+
} catch (e) {}
|
|
154
|
+
|
|
155
|
+
try {
|
|
156
|
+
if (fs.existsSync(FALLBACK_TOKEN_PATH)) {
|
|
157
|
+
fs.unlinkSync(FALLBACK_TOKEN_PATH);
|
|
158
|
+
}
|
|
159
|
+
} catch (e) {}
|
|
160
|
+
|
|
161
|
+
accessToken = null;
|
|
162
|
+
tokenExpiry = 0;
|
|
163
|
+
console.log('[Google Auth] Successfully logged out.');
|
|
164
|
+
return true;
|
|
165
|
+
}
|
|
166
|
+
|
|
148
167
|
// ---- Secure Storage for Refresh Token ----
|
|
149
168
|
|
|
150
169
|
async function saveRefreshToken(token: string) {
|
|
@@ -44,7 +44,7 @@ import { readGmailInboxToolDefinition, listCalendarEventsToolDefinition, appendR
|
|
|
44
44
|
|
|
45
45
|
import { startTelegramBot } from './telegram';
|
|
46
46
|
import { formatTransactionSuccess, formatTransactionError } from '../utils/formatter';
|
|
47
|
-
import { initGoogleAuth, getAuthUrl, processCallback, isAuthenticated } from './googleAuthModule';
|
|
47
|
+
import { initGoogleAuth, getAuthUrl, processCallback, isAuthenticated, logoutGoogle } from './googleAuthModule';
|
|
48
48
|
|
|
49
49
|
// Initialize Google Auth
|
|
50
50
|
initGoogleAuth();
|
|
@@ -291,7 +291,13 @@ app.get('/api/auth/google/callback', async (req, res) => {
|
|
|
291
291
|
});
|
|
292
292
|
|
|
293
293
|
app.get('/api/auth/google/status', async (req, res) => {
|
|
294
|
-
|
|
294
|
+
const connected = await isAuthenticated();
|
|
295
|
+
res.json({ connected });
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
app.delete('/api/auth/google', async (req, res) => {
|
|
299
|
+
const success = await logoutGoogle();
|
|
300
|
+
res.json({ success });
|
|
295
301
|
});
|
|
296
302
|
|
|
297
303
|
app.get('/api/transactions', (req, res) => {
|
|
@@ -405,7 +411,7 @@ export function startServer() {
|
|
|
405
411
|
limitOrderManager.startMonitor();
|
|
406
412
|
|
|
407
413
|
const PORT = Number(process.env.PORT || 3000);
|
|
408
|
-
app.listen(PORT, '
|
|
414
|
+
app.listen(PORT, '0.0.0.0', () => {
|
|
409
415
|
console.log(`🤖 Nyxora API Server running on port ${PORT}`);
|
|
410
416
|
|
|
411
417
|
// Start the Telegram bot listener
|