nyxora 1.1.2 → 1.1.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.
- package/dist/agent/reasoning.js +14 -4
- package/dist/gateway/server.js +2 -0
- package/dist/gateway/telegram.js +3 -0
- package/package.json +48 -48
- package/user.md +9 -9
package/dist/agent/reasoning.js
CHANGED
|
@@ -111,8 +111,13 @@ async function processUserInput(input, role = 'user') {
|
|
|
111
111
|
// Format messages for OpenAI
|
|
112
112
|
const messages = [
|
|
113
113
|
{ role: 'system', content: getSystemPrompt() },
|
|
114
|
-
...history
|
|
115
|
-
|
|
114
|
+
...history
|
|
115
|
+
.filter(m => !(m.role === 'tool' && !m.tool_call_id))
|
|
116
|
+
.map(m => {
|
|
117
|
+
let role = m.role;
|
|
118
|
+
if (role === 'system')
|
|
119
|
+
role = 'user';
|
|
120
|
+
const msg = { role, content: m.content || "" };
|
|
116
121
|
if (m.name)
|
|
117
122
|
msg.name = m.name;
|
|
118
123
|
if (m.tool_call_id)
|
|
@@ -195,8 +200,13 @@ async function processUserInput(input, role = 'user') {
|
|
|
195
200
|
// Second call to get the final answer after tool execution
|
|
196
201
|
const secondMessages = [
|
|
197
202
|
{ role: 'system', content: getSystemPrompt() },
|
|
198
|
-
...exports.logger.getHistory()
|
|
199
|
-
|
|
203
|
+
...exports.logger.getHistory()
|
|
204
|
+
.filter(m => !(m.role === 'tool' && !m.tool_call_id))
|
|
205
|
+
.map(m => {
|
|
206
|
+
let role = m.role;
|
|
207
|
+
if (role === 'system')
|
|
208
|
+
role = 'user';
|
|
209
|
+
const msg = { role, content: m.content || "" };
|
|
200
210
|
if (m.name)
|
|
201
211
|
msg.name = m.name;
|
|
202
212
|
if (m.tool_call_id)
|
package/dist/gateway/server.js
CHANGED
|
@@ -119,6 +119,8 @@ app.post('/api/transactions/:id/approve', async (req, res) => {
|
|
|
119
119
|
// Add programmatic beautiful message directly to chat
|
|
120
120
|
const prettyMsg = (0, formatter_1.formatTransactionSuccess)(tx, result);
|
|
121
121
|
reasoning_1.logger.addEntry({ role: 'assistant', content: `✅ Transaction processed:\n\n${prettyMsg}` });
|
|
122
|
+
// Add tool message so the UI can render the beautiful JSON widget!
|
|
123
|
+
reasoning_1.logger.addEntry({ role: 'tool', name: tx.type === 'swap' ? 'swap_token' : 'transfer_native', content: result });
|
|
122
124
|
// Background update to LLM
|
|
123
125
|
(0, reasoning_1.processUserInput)(`Transaction ${id} was APPROVED and EXECUTED by the user via Dashboard. Result: ${result}`, 'system').catch(() => { });
|
|
124
126
|
res.json({ success: true, result });
|
package/dist/gateway/telegram.js
CHANGED
|
@@ -81,6 +81,9 @@ function startTelegramBot() {
|
|
|
81
81
|
transactionManager_1.txManager.updateStatus(txId, 'executed', result);
|
|
82
82
|
const prettyMsg = (0, formatter_1.formatTransactionSuccess)(tx, result);
|
|
83
83
|
bot.sendMessage(chatId, `✅ Transaction processed:\n\n${prettyMsg}`);
|
|
84
|
+
// Sync with dashboard
|
|
85
|
+
reasoning_1.logger.addEntry({ role: 'assistant', content: `✅ Transaction processed:\n\n${prettyMsg}` });
|
|
86
|
+
reasoning_1.logger.addEntry({ role: 'tool', name: tx.type === 'swap' ? 'swap_token' : 'transfer_native', content: result });
|
|
84
87
|
// Background update to LLM
|
|
85
88
|
(0, reasoning_1.processUserInput)(`Transaction ${txId} was APPROVED via Telegram. Result: ${result}`, 'system').catch(() => { });
|
|
86
89
|
}
|
package/package.json
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "nyxora",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "dist/gateway/cli.js",
|
|
6
|
-
"files": [
|
|
7
|
-
"dist",
|
|
8
|
-
"dashboard/dist",
|
|
9
|
-
"user.md",
|
|
10
|
-
"IDENTITY.md",
|
|
11
|
-
"SECURITY.md",
|
|
12
|
-
"README.md"
|
|
13
|
-
],
|
|
14
|
-
"bin": {
|
|
15
|
-
"nyxora": "./dist/gateway/cli.js"
|
|
16
|
-
},
|
|
17
|
-
"scripts": {
|
|
18
|
-
"build": "npm run build --prefix dashboard && tsc",
|
|
19
|
-
"start": "node dist/gateway/cli.js",
|
|
20
|
-
"dashboard": "npm run build && node dist/gateway/cli.js",
|
|
21
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
22
|
-
"deploy": "npm run build && git add . && git commit -m \"chore: auto-deploy new feature\" && git push && git push --tags && npm publish"
|
|
23
|
-
},
|
|
24
|
-
"keywords": [],
|
|
25
|
-
"author": "",
|
|
26
|
-
"license": "ISC",
|
|
27
|
-
"type": "commonjs",
|
|
28
|
-
"dependencies": {
|
|
29
|
-
"@clack/prompts": "^1.4.0",
|
|
30
|
-
"concurrently": "^9.2.1",
|
|
31
|
-
"cors": "^2.8.6",
|
|
32
|
-
"express": "^5.2.1",
|
|
33
|
-
"node-telegram-bot-api": "^0.67.0",
|
|
34
|
-
"open": "^11.0.0",
|
|
35
|
-
"openai": "^6.39.0",
|
|
36
|
-
"picocolors": "^1.1.1",
|
|
37
|
-
"viem": "^2.51.0",
|
|
38
|
-
"yaml": "^2.9.0"
|
|
39
|
-
},
|
|
40
|
-
"devDependencies": {
|
|
41
|
-
"@types/cors": "^2.8.19",
|
|
42
|
-
"@types/express": "^5.0.6",
|
|
43
|
-
"@types/node": "^25.9.1",
|
|
44
|
-
"@types/node-telegram-bot-api": "^0.64.14",
|
|
45
|
-
"ts-node": "^10.9.2",
|
|
46
|
-
"typescript": "^6.0.3"
|
|
47
|
-
}
|
|
48
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "nyxora",
|
|
3
|
+
"version": "1.1.5",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/gateway/cli.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist",
|
|
8
|
+
"dashboard/dist",
|
|
9
|
+
"user.md",
|
|
10
|
+
"IDENTITY.md",
|
|
11
|
+
"SECURITY.md",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
14
|
+
"bin": {
|
|
15
|
+
"nyxora": "./dist/gateway/cli.js"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "npm run build --prefix dashboard && tsc",
|
|
19
|
+
"start": "node dist/gateway/cli.js",
|
|
20
|
+
"dashboard": "npm run build && node dist/gateway/cli.js",
|
|
21
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
22
|
+
"deploy": "npm run build && git add . && git commit -m \"chore: auto-deploy new feature\" && git push && git push --tags && npm publish"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [],
|
|
25
|
+
"author": "",
|
|
26
|
+
"license": "ISC",
|
|
27
|
+
"type": "commonjs",
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@clack/prompts": "^1.4.0",
|
|
30
|
+
"concurrently": "^9.2.1",
|
|
31
|
+
"cors": "^2.8.6",
|
|
32
|
+
"express": "^5.2.1",
|
|
33
|
+
"node-telegram-bot-api": "^0.67.0",
|
|
34
|
+
"open": "^11.0.0",
|
|
35
|
+
"openai": "^6.39.0",
|
|
36
|
+
"picocolors": "^1.1.1",
|
|
37
|
+
"viem": "^2.51.0",
|
|
38
|
+
"yaml": "^2.9.0"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@types/cors": "^2.8.19",
|
|
42
|
+
"@types/express": "^5.0.6",
|
|
43
|
+
"@types/node": "^25.9.1",
|
|
44
|
+
"@types/node-telegram-bot-api": "^0.64.14",
|
|
45
|
+
"ts-node": "^10.9.2",
|
|
46
|
+
"typescript": "^6.0.3"
|
|
47
|
+
}
|
|
48
|
+
}
|
package/user.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
Write custom instructions, special rules, user profiles, or the persona you want for Nyxora AI in this file.
|
|
2
|
-
|
|
3
|
-
Every time the agent reads your messages, it will read this file first as its primary guideline.
|
|
4
|
-
|
|
5
|
-
Examples:
|
|
6
|
-
|
|
7
|
-
* "Call me Yudha"
|
|
8
|
-
* "Use casual and slang language"
|
|
9
|
-
* "Focus analysis from a technical trading perspective"
|
|
1
|
+
Write custom instructions, special rules, user profiles, or the persona you want for Nyxora AI in this file.
|
|
2
|
+
|
|
3
|
+
Every time the agent reads your messages, it will read this file first as its primary guideline.
|
|
4
|
+
|
|
5
|
+
Examples:
|
|
6
|
+
|
|
7
|
+
* "Call me Yudha"
|
|
8
|
+
* "Use casual and slang language"
|
|
9
|
+
* "Focus analysis from a technical trading perspective"
|