claude-scionos 3.0.2 → 3.0.3
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/.claude/settings.local.json +9 -0
- package/CHANGELOG.md +10 -0
- package/index.js +21 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,16 @@ 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
|
+
## [3.0.3] - 2026-02-18
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- **Model**: Renamed `GLM-4.7` to `Kimi K2.5` (`kimi-k2.5`) in the model selection menu.
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
- **Token Validation**: Added a 10-second `AbortController` timeout on `validateToken()` to prevent the prompt from hanging on unresponsive network.
|
|
15
|
+
- **Proxy Memory**: Added a 100 MB cap on incoming request buffers; oversized requests now return HTTP 413 instead of causing a memory overflow.
|
|
16
|
+
- **CI/CD Compatibility**: `console.clear()` is now skipped when the `CI` environment variable is set or `--no-clear` is passed, preventing broken output in pipelines.
|
|
17
|
+
|
|
8
18
|
## [3.0.2] - 2026-01-11
|
|
9
19
|
|
|
10
20
|
### Added
|
package/index.js
CHANGED
|
@@ -24,7 +24,7 @@ const BASE_URL = "https://routerlab.ch";
|
|
|
24
24
|
* Displays the application banner
|
|
25
25
|
*/
|
|
26
26
|
function showBanner() {
|
|
27
|
-
console.clear();
|
|
27
|
+
if (!process.env.CI && !process.argv.includes('--no-clear')) console.clear();
|
|
28
28
|
const p = chalk.hex('#3b82f6'); // Primary (Scio)
|
|
29
29
|
const s = chalk.hex('#a855f7'); // Secondary (Nos)
|
|
30
30
|
const c = chalk.hex('#D97757'); // Claude Orange
|
|
@@ -47,13 +47,17 @@ function showBanner() {
|
|
|
47
47
|
*/
|
|
48
48
|
async function validateToken(apiKey) {
|
|
49
49
|
try {
|
|
50
|
+
const controller = new AbortController();
|
|
51
|
+
const timeoutId = setTimeout(() => controller.abort(), 10000);
|
|
50
52
|
const response = await fetch(`${BASE_URL}/v1/models`, {
|
|
51
53
|
method: 'GET',
|
|
52
54
|
headers: {
|
|
53
55
|
'x-api-key': apiKey,
|
|
54
56
|
'anthropic-version': '2023-06-01'
|
|
55
|
-
}
|
|
57
|
+
},
|
|
58
|
+
signal: controller.signal
|
|
56
59
|
});
|
|
60
|
+
clearTimeout(timeoutId);
|
|
57
61
|
|
|
58
62
|
if (response.ok) {
|
|
59
63
|
return { valid: true };
|
|
@@ -91,7 +95,18 @@ function startProxyServer(targetModel, validToken) {
|
|
|
91
95
|
// Claude Code uses /v1/messages
|
|
92
96
|
if (req.method === 'POST' && req.url.includes('/messages')) {
|
|
93
97
|
const chunks = [];
|
|
94
|
-
|
|
98
|
+
const MAX_SIZE = 100 * 1024 * 1024; // 100MB
|
|
99
|
+
let totalSize = 0;
|
|
100
|
+
req.on('data', chunk => {
|
|
101
|
+
totalSize += chunk.length;
|
|
102
|
+
if (totalSize > MAX_SIZE) {
|
|
103
|
+
res.writeHead(413);
|
|
104
|
+
res.end(JSON.stringify({ error: { message: 'Request too large' } }));
|
|
105
|
+
req.destroy();
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
chunks.push(chunk);
|
|
109
|
+
});
|
|
95
110
|
req.on('end', async () => {
|
|
96
111
|
try {
|
|
97
112
|
const bodyBuffer = Buffer.concat(chunks);
|
|
@@ -293,9 +308,9 @@ const modelChoice = await select({
|
|
|
293
308
|
description: 'Standard behavior. Claude decides which model to use.'
|
|
294
309
|
},
|
|
295
310
|
{
|
|
296
|
-
name: '
|
|
297
|
-
value: '
|
|
298
|
-
description: '
|
|
311
|
+
name: 'Kimi K2.5',
|
|
312
|
+
value: 'kimi-k2.5',
|
|
313
|
+
description: 'Force all requests to Kimi K2.5'
|
|
299
314
|
},
|
|
300
315
|
{
|
|
301
316
|
name: 'Force MiniMax-M2.1 (Map all models to MiniMax)',
|