nyxora 26.6.18 → 26.6.19
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/packages/core/src/agent/reasoning.js +0 -3
- package/dist/packages/core/src/gateway/server.js +2 -1
- package/dist/packages/core/src/gateway/setup.js +58 -6
- package/package.json +2 -2
- package/packages/core/package.json +1 -1
- package/packages/core/src/agent/reasoning.ts +0 -4
- package/packages/core/src/gateway/server.ts +2 -1
- package/packages/core/src/gateway/setup.ts +60 -6
- package/packages/dashboard/package.json +1 -1
- package/packages/mcp-server/package.json +1 -1
- package/packages/policy/package.json +1 -1
- package/packages/signer/package.json +1 -1
|
@@ -245,9 +245,6 @@ async function processUserInput(input, role = 'user', onProgress, sessionId) {
|
|
|
245
245
|
})
|
|
246
246
|
];
|
|
247
247
|
try {
|
|
248
|
-
if (config.llm.provider !== 'openai' && config.llm.provider !== 'ollama' && config.llm.provider !== 'gemini' && config.llm.provider !== 'openrouter') {
|
|
249
|
-
return `Provider ${config.llm.provider} is configured, but currently only OpenAI, OpenRouter, Ollama, and Gemini adapters are implemented.`;
|
|
250
|
-
}
|
|
251
248
|
const lowerInput = input.toLowerCase();
|
|
252
249
|
const hasWeb3Keyword = /swap|transfer|price|token|crypto|bridge|wallet|balance|portfolio|buy|sell|send|receive|address|market|limit|mint|nft/i.test(lowerInput);
|
|
253
250
|
const hasGoogleKeyword = /email|gmail|calendar|sheet|doc|form|event/i.test(lowerInput);
|
|
@@ -124,7 +124,8 @@ app.use('/api/', apiLimiter);
|
|
|
124
124
|
app.use('/api', (req, res, next) => {
|
|
125
125
|
// Bypass auth for Google OAuth callback and URLs since they are handled externally or by the browser
|
|
126
126
|
const allowedPaths = ['/api/auth/google/url', '/api/auth/google/callback', '/api/auth/google/status', '/api/auth/google'];
|
|
127
|
-
|
|
127
|
+
const currentPath = req.originalUrl.split('?')[0];
|
|
128
|
+
if (allowedPaths.includes(currentPath) || allowedPaths.includes(currentPath.replace(/\/$/, ''))) {
|
|
128
129
|
return next();
|
|
129
130
|
}
|
|
130
131
|
const token = req.headers['x-nyxora-token'];
|
|
@@ -439,18 +439,70 @@ Provider: ${config.llm.provider}`;
|
|
|
439
439
|
'audioTranscribe', 'summarizeText'
|
|
440
440
|
];
|
|
441
441
|
const disabledSkills = [];
|
|
442
|
+
const skillMapping = {
|
|
443
|
+
// OS Skills
|
|
444
|
+
readFile: 'read_local_file',
|
|
445
|
+
writeFile: 'write_local_file',
|
|
446
|
+
editFile: 'edit_local_file',
|
|
447
|
+
generateExcel: 'generate_excel_file',
|
|
448
|
+
analyzeDocument: 'analyze_document',
|
|
449
|
+
run_terminal: 'run_terminal_command',
|
|
450
|
+
gitManager: 'execute_git_command',
|
|
451
|
+
updateSecurityPolicy: 'update_security_policy',
|
|
452
|
+
browseWeb: 'browse_website',
|
|
453
|
+
searchWeb: 'search_web',
|
|
454
|
+
googleWorkspace: [
|
|
455
|
+
'read_gmail_inbox',
|
|
456
|
+
'list_calendar_events',
|
|
457
|
+
'append_row_to_sheets',
|
|
458
|
+
'read_google_docs',
|
|
459
|
+
'read_google_form_responses'
|
|
460
|
+
],
|
|
461
|
+
notionWorkspace: 'manage_notion',
|
|
462
|
+
xManager: 'manage_twitter',
|
|
463
|
+
audioTranscribe: 'transcribe_audio',
|
|
464
|
+
summarizeText: 'summarize_text',
|
|
465
|
+
// Web3 Skills
|
|
466
|
+
transfer: 'transfer_token',
|
|
467
|
+
swapToken: 'swap_token',
|
|
468
|
+
bridgeToken: 'bridge_token',
|
|
469
|
+
customTx: 'custom_tx',
|
|
470
|
+
mintNft: 'mint_nft',
|
|
471
|
+
defiLending: 'supply_aave',
|
|
472
|
+
provideLiquidity: 'provide_liquidity_v3',
|
|
473
|
+
yieldVault: 'deposit_yield_vault',
|
|
474
|
+
revokeApprovals: 'revoke_approval',
|
|
475
|
+
getBalance: 'get_balance',
|
|
476
|
+
getMyAddress: 'get_my_address',
|
|
477
|
+
checkPortfolio: 'check_portfolio',
|
|
478
|
+
getPrice: 'get_price',
|
|
479
|
+
marketAnalysis: 'analyze_market',
|
|
480
|
+
getTxHistory: 'get_tx_history',
|
|
481
|
+
checkSecurity: 'check_token_security',
|
|
482
|
+
checkAddress: 'check_address',
|
|
483
|
+
checkRegistryStatus: 'check_registry_status',
|
|
484
|
+
manageCustomTokens: 'manage_custom_tokens'
|
|
485
|
+
};
|
|
486
|
+
const processDisabledSkill = (skill) => {
|
|
487
|
+
const mapped = skillMapping[skill];
|
|
488
|
+
if (Array.isArray(mapped)) {
|
|
489
|
+
disabledSkills.push(...mapped);
|
|
490
|
+
}
|
|
491
|
+
else if (mapped) {
|
|
492
|
+
disabledSkills.push(mapped);
|
|
493
|
+
}
|
|
494
|
+
else {
|
|
495
|
+
disabledSkills.push(skill);
|
|
496
|
+
}
|
|
497
|
+
};
|
|
442
498
|
allWeb3Skills.forEach(skill => {
|
|
443
499
|
if (!activeWeb3Skills.includes(skill))
|
|
444
|
-
|
|
500
|
+
processDisabledSkill(skill);
|
|
445
501
|
});
|
|
446
502
|
allOsSkills.forEach(skill => {
|
|
447
503
|
if (!activeOsSkills.includes(skill))
|
|
448
|
-
|
|
504
|
+
processDisabledSkill(skill);
|
|
449
505
|
});
|
|
450
|
-
// Note: the backend uses 'run_terminal_command', but the UI/wizard used 'run_terminal'
|
|
451
|
-
// I need to map it just in case:
|
|
452
|
-
if (!activeOsSkills.includes('run_terminal'))
|
|
453
|
-
disabledSkills.push('run_terminal_command');
|
|
454
506
|
fs_1.default.writeFileSync((0, paths_1.getPath)('disabled_skills.json'), JSON.stringify(disabledSkills, null, 2));
|
|
455
507
|
// Save Private Key to OS Keyring or fallback to .env
|
|
456
508
|
if (privateKey) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nyxora",
|
|
3
|
-
"version": "26.6.
|
|
3
|
+
"version": "26.6.19",
|
|
4
4
|
"description": "Your Personal Web3 Assistant",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web3",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"nyxora": "bin/nyxora.mjs"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
|
-
"
|
|
39
|
+
"prepublishOnly": "npm run build",
|
|
40
40
|
"dev": "concurrently -n \"BACKEND,FRONTEND\" -c \"blue,green\" \"NODE_NO_WARNINGS=1 ./node_modules/.bin/ts-node -T launcher.ts\" \"npm run dev --workspace=nyxora-dashboard\"",
|
|
41
41
|
"start": "node ./bin/nyxora.mjs start",
|
|
42
42
|
"stop": "node ./bin/nyxora.mjs stop",
|
|
@@ -270,10 +270,6 @@ export async function processUserInput(input: string, role: 'user' | 'system' =
|
|
|
270
270
|
];
|
|
271
271
|
|
|
272
272
|
try {
|
|
273
|
-
if (config.llm.provider !== 'openai' && config.llm.provider !== 'ollama' && config.llm.provider !== 'gemini' && config.llm.provider !== 'openrouter') {
|
|
274
|
-
return `Provider ${config.llm.provider} is configured, but currently only OpenAI, OpenRouter, Ollama, and Gemini adapters are implemented.`;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
273
|
const lowerInput = input.toLowerCase();
|
|
278
274
|
const hasWeb3Keyword = /swap|transfer|price|token|crypto|bridge|wallet|balance|portfolio|buy|sell|send|receive|address|market|limit|mint|nft/i.test(lowerInput);
|
|
279
275
|
const hasGoogleKeyword = /email|gmail|calendar|sheet|doc|form|event/i.test(lowerInput);
|
|
@@ -137,7 +137,8 @@ app.use('/api/', apiLimiter);
|
|
|
137
137
|
app.use('/api', (req, res, next) => {
|
|
138
138
|
// Bypass auth for Google OAuth callback and URLs since they are handled externally or by the browser
|
|
139
139
|
const allowedPaths = ['/api/auth/google/url', '/api/auth/google/callback', '/api/auth/google/status', '/api/auth/google'];
|
|
140
|
-
|
|
140
|
+
const currentPath = req.originalUrl.split('?')[0];
|
|
141
|
+
if (allowedPaths.includes(currentPath) || allowedPaths.includes(currentPath.replace(/\/$/, ''))) {
|
|
141
142
|
return next();
|
|
142
143
|
}
|
|
143
144
|
|
|
@@ -463,17 +463,71 @@ Provider: ${config.llm.provider}`;
|
|
|
463
463
|
];
|
|
464
464
|
|
|
465
465
|
const disabledSkills: string[] = [];
|
|
466
|
+
|
|
467
|
+
const skillMapping: Record<string, string | string[]> = {
|
|
468
|
+
// OS Skills
|
|
469
|
+
readFile: 'read_local_file',
|
|
470
|
+
writeFile: 'write_local_file',
|
|
471
|
+
editFile: 'edit_local_file',
|
|
472
|
+
generateExcel: 'generate_excel_file',
|
|
473
|
+
analyzeDocument: 'analyze_document',
|
|
474
|
+
run_terminal: 'run_terminal_command',
|
|
475
|
+
gitManager: 'execute_git_command',
|
|
476
|
+
updateSecurityPolicy: 'update_security_policy',
|
|
477
|
+
browseWeb: 'browse_website',
|
|
478
|
+
searchWeb: 'search_web',
|
|
479
|
+
googleWorkspace: [
|
|
480
|
+
'read_gmail_inbox',
|
|
481
|
+
'list_calendar_events',
|
|
482
|
+
'append_row_to_sheets',
|
|
483
|
+
'read_google_docs',
|
|
484
|
+
'read_google_form_responses'
|
|
485
|
+
],
|
|
486
|
+
notionWorkspace: 'manage_notion',
|
|
487
|
+
xManager: 'manage_twitter',
|
|
488
|
+
audioTranscribe: 'transcribe_audio',
|
|
489
|
+
summarizeText: 'summarize_text',
|
|
490
|
+
|
|
491
|
+
// Web3 Skills
|
|
492
|
+
transfer: 'transfer_token',
|
|
493
|
+
swapToken: 'swap_token',
|
|
494
|
+
bridgeToken: 'bridge_token',
|
|
495
|
+
customTx: 'custom_tx',
|
|
496
|
+
mintNft: 'mint_nft',
|
|
497
|
+
defiLending: 'supply_aave',
|
|
498
|
+
provideLiquidity: 'provide_liquidity_v3',
|
|
499
|
+
yieldVault: 'deposit_yield_vault',
|
|
500
|
+
revokeApprovals: 'revoke_approval',
|
|
501
|
+
getBalance: 'get_balance',
|
|
502
|
+
getMyAddress: 'get_my_address',
|
|
503
|
+
checkPortfolio: 'check_portfolio',
|
|
504
|
+
getPrice: 'get_price',
|
|
505
|
+
marketAnalysis: 'analyze_market',
|
|
506
|
+
getTxHistory: 'get_tx_history',
|
|
507
|
+
checkSecurity: 'check_token_security',
|
|
508
|
+
checkAddress: 'check_address',
|
|
509
|
+
checkRegistryStatus: 'check_registry_status',
|
|
510
|
+
manageCustomTokens: 'manage_custom_tokens'
|
|
511
|
+
};
|
|
512
|
+
|
|
513
|
+
const processDisabledSkill = (skill: string) => {
|
|
514
|
+
const mapped = skillMapping[skill];
|
|
515
|
+
if (Array.isArray(mapped)) {
|
|
516
|
+
disabledSkills.push(...mapped);
|
|
517
|
+
} else if (mapped) {
|
|
518
|
+
disabledSkills.push(mapped);
|
|
519
|
+
} else {
|
|
520
|
+
disabledSkills.push(skill);
|
|
521
|
+
}
|
|
522
|
+
};
|
|
523
|
+
|
|
466
524
|
allWeb3Skills.forEach(skill => {
|
|
467
|
-
if (!activeWeb3Skills.includes(skill))
|
|
525
|
+
if (!activeWeb3Skills.includes(skill)) processDisabledSkill(skill);
|
|
468
526
|
});
|
|
469
527
|
allOsSkills.forEach(skill => {
|
|
470
|
-
if (!activeOsSkills.includes(skill))
|
|
528
|
+
if (!activeOsSkills.includes(skill)) processDisabledSkill(skill);
|
|
471
529
|
});
|
|
472
530
|
|
|
473
|
-
// Note: the backend uses 'run_terminal_command', but the UI/wizard used 'run_terminal'
|
|
474
|
-
// I need to map it just in case:
|
|
475
|
-
if (!activeOsSkills.includes('run_terminal')) disabledSkills.push('run_terminal_command');
|
|
476
|
-
|
|
477
531
|
fs.writeFileSync(getPath('disabled_skills.json'), JSON.stringify(disabledSkills, null, 2));
|
|
478
532
|
|
|
479
533
|
// Save Private Key to OS Keyring or fallback to .env
|