@mmmbuto/nexuscli 0.6.3 → 0.7.0
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/bin/nexuscli.js +7 -0
- package/frontend/dist/assets/{index-DaG2hvsF.js → index-DuqGKSR-.js} +1702 -1702
- package/frontend/dist/index.html +1 -1
- package/lib/cli/model.js +56 -0
- package/lib/config/manager.js +3 -0
- package/lib/server/routes/config.js +30 -0
- package/lib/server/server.js +2 -0
- package/package.json +1 -1
package/frontend/dist/index.html
CHANGED
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
|
|
60
60
|
<!-- Prevent Scaling on iOS -->
|
|
61
61
|
<meta name="format-detection" content="telephone=no" />
|
|
62
|
-
<script type="module" crossorigin src="/assets/index-
|
|
62
|
+
<script type="module" crossorigin src="/assets/index-DuqGKSR-.js"></script>
|
|
63
63
|
<link rel="stylesheet" crossorigin href="/assets/index-Bn_l1e6e.css">
|
|
64
64
|
</head>
|
|
65
65
|
<body>
|
package/lib/cli/model.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model Management CLI Command
|
|
3
|
+
* Set/get default model preference
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const chalk = require('chalk');
|
|
7
|
+
const { getConfig, setConfigValue } = require('../config/manager');
|
|
8
|
+
|
|
9
|
+
async function modelCommand(modelId) {
|
|
10
|
+
|
|
11
|
+
// If no model specified, show current default
|
|
12
|
+
if (!modelId) {
|
|
13
|
+
const config = getConfig();
|
|
14
|
+
const current = config.preferences?.defaultModel;
|
|
15
|
+
|
|
16
|
+
if (current) {
|
|
17
|
+
console.log(chalk.bold('Current default model:'));
|
|
18
|
+
console.log(chalk.cyan(` ${current}`));
|
|
19
|
+
} else {
|
|
20
|
+
console.log(chalk.yellow('No default model set.'));
|
|
21
|
+
console.log(chalk.dim('Usage: nexuscli model <model-id>'));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Show available models
|
|
25
|
+
console.log(chalk.bold('\nAvailable models:'));
|
|
26
|
+
console.log(chalk.dim('Claude:'));
|
|
27
|
+
console.log(' claude-sonnet-4-5-20250929');
|
|
28
|
+
console.log(' claude-opus-4-5-20250514');
|
|
29
|
+
console.log(' claude-3-7-sonnet-20250219');
|
|
30
|
+
console.log(' claude-haiku-4-5-20250514');
|
|
31
|
+
console.log(chalk.dim('OpenAI (Codex):'));
|
|
32
|
+
console.log(' gpt-5.1-codex-max');
|
|
33
|
+
console.log(' gpt-5.1');
|
|
34
|
+
console.log(' o1-preview');
|
|
35
|
+
console.log(' o1-mini');
|
|
36
|
+
console.log(chalk.dim('Google (Gemini):'));
|
|
37
|
+
console.log(' gemini-3-pro-preview');
|
|
38
|
+
console.log(' gemini-2-5-pro-exp-0827');
|
|
39
|
+
console.log(' gemini-2-0-flash-exp');
|
|
40
|
+
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Set default model
|
|
45
|
+
const success = setConfigValue('preferences.defaultModel', modelId);
|
|
46
|
+
|
|
47
|
+
if (success) {
|
|
48
|
+
console.log(chalk.green('✓') + ' Default model set to: ' + chalk.cyan(modelId));
|
|
49
|
+
console.log(chalk.dim('The frontend will now auto-select this model on load.'));
|
|
50
|
+
} else {
|
|
51
|
+
console.error(chalk.red('✗') + ' Failed to save config');
|
|
52
|
+
process.exit(1);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
module.exports = { modelCommand };
|
package/lib/config/manager.js
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Config API Routes
|
|
3
|
+
* GET /api/v1/config - Get user preferences
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const express = require('express');
|
|
7
|
+
const router = express.Router();
|
|
8
|
+
const { getConfig } = require('../../config/manager');
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* GET /api/v1/config
|
|
12
|
+
* Return user preferences (defaultModel, etc.)
|
|
13
|
+
*/
|
|
14
|
+
router.get('/', (req, res) => {
|
|
15
|
+
try {
|
|
16
|
+
const config = getConfig();
|
|
17
|
+
|
|
18
|
+
// Return only preferences (not sensitive data like auth)
|
|
19
|
+
const preferences = {
|
|
20
|
+
defaultModel: config.preferences?.defaultModel || null
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
res.json(preferences);
|
|
24
|
+
} catch (error) {
|
|
25
|
+
console.error('[Config API] Error:', error);
|
|
26
|
+
res.status(500).json({ error: 'Failed to load config' });
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
module.exports = router;
|
package/lib/server/server.js
CHANGED
|
@@ -28,6 +28,7 @@ const wakeLockRouter = require('./routes/wake-lock');
|
|
|
28
28
|
const uploadRouter = require('./routes/upload');
|
|
29
29
|
const keysRouter = require('./routes/keys');
|
|
30
30
|
const speechRouter = require('./routes/speech');
|
|
31
|
+
const configRouter = require('./routes/config');
|
|
31
32
|
|
|
32
33
|
const app = express();
|
|
33
34
|
const PORT = process.env.PORT || 41800;
|
|
@@ -62,6 +63,7 @@ app.use(express.static(frontendDist));
|
|
|
62
63
|
// Public routes
|
|
63
64
|
app.use('/api/v1/auth', authRouter);
|
|
64
65
|
app.use('/api/v1/models', modelsRouter);
|
|
66
|
+
app.use('/api/v1/config', configRouter);
|
|
65
67
|
app.use('/api/v1/workspace', workspaceRouter);
|
|
66
68
|
app.use('/api/v1', wakeLockRouter); // Wake lock endpoints (public for app visibility handling)
|
|
67
69
|
app.use('/api/v1/workspaces', authMiddleware, workspacesRouter);
|