aihezu 2.8.3 → 2.8.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/commands/config.js +10 -7
- package/commands/install.js +10 -7
- package/commands/usage.js +26 -0
- package/package.json +1 -1
package/commands/config.js
CHANGED
|
@@ -101,22 +101,25 @@ async function configCommand(service, args = []) {
|
|
|
101
101
|
// 3. Extra Options (Service specific)
|
|
102
102
|
const options = {};
|
|
103
103
|
if (service.name === 'codex') {
|
|
104
|
-
const knownModels = ['gpt-5-codex', 'gpt-5.
|
|
104
|
+
const knownModels = ['gpt-5-codex', 'gpt-5.2', 'gpt-5.2-codex', 'gpt-5.3-codex'];
|
|
105
105
|
let defaultModel = cliModel || 'gpt-5-codex';
|
|
106
106
|
|
|
107
107
|
console.log('请选择模型:');
|
|
108
108
|
console.log(' [1] gpt-5-codex' + (defaultModel === 'gpt-5-codex' ? ' (默认)' : ''));
|
|
109
|
-
console.log(' [2] gpt-5.
|
|
110
|
-
console.log(' [3]
|
|
111
|
-
console.log(' [4]
|
|
109
|
+
console.log(' [2] gpt-5.2' + (defaultModel === 'gpt-5.2' ? ' (默认)' : ''));
|
|
110
|
+
console.log(' [3] gpt-5.2-codex' + (defaultModel === 'gpt-5.2-codex' ? ' (默认)' : ''));
|
|
111
|
+
console.log(' [4] gpt-5.3-codex' + (defaultModel === 'gpt-5.3-codex' ? ' (默认)' : ''));
|
|
112
|
+
console.log(' [5] 自定义模型名称' + (!knownModels.includes(defaultModel) ? ' (默认: ' + defaultModel + ')' : ''));
|
|
112
113
|
|
|
113
|
-
const choice = await askQuestion(rl, '请选择 [1/2/3/4]: ');
|
|
114
|
+
const choice = await askQuestion(rl, '请选择 [1/2/3/4/5]: ');
|
|
114
115
|
|
|
115
116
|
if (choice === '2') {
|
|
116
|
-
options.modelName = 'gpt-5.
|
|
117
|
+
options.modelName = 'gpt-5.2';
|
|
117
118
|
} else if (choice === '3') {
|
|
118
|
-
options.modelName = '
|
|
119
|
+
options.modelName = 'gpt-5.2-codex';
|
|
119
120
|
} else if (choice === '4') {
|
|
121
|
+
options.modelName = 'gpt-5.3-codex';
|
|
122
|
+
} else if (choice === '5') {
|
|
120
123
|
const customModel = await askQuestion(rl, '请输入自定义模型名称: ');
|
|
121
124
|
options.modelName = customModel || defaultModel;
|
|
122
125
|
} else if (choice === '1' || choice === '') {
|
package/commands/install.js
CHANGED
|
@@ -102,22 +102,25 @@ async function installCommand(service, args = []) {
|
|
|
102
102
|
// 3. Extra Options (Service specific)
|
|
103
103
|
const options = {};
|
|
104
104
|
if (service.name === 'codex') {
|
|
105
|
-
const knownModels = ['gpt-5-codex', 'gpt-5.
|
|
105
|
+
const knownModels = ['gpt-5-codex', 'gpt-5.2', 'gpt-5.2-codex', 'gpt-5.3-codex'];
|
|
106
106
|
let defaultModel = cliModel || 'gpt-5-codex';
|
|
107
107
|
|
|
108
108
|
console.log('请选择模型:');
|
|
109
109
|
console.log(' [1] gpt-5-codex' + (defaultModel === 'gpt-5-codex' ? ' (默认)' : ''));
|
|
110
|
-
console.log(' [2] gpt-5.
|
|
111
|
-
console.log(' [3]
|
|
112
|
-
console.log(' [4]
|
|
110
|
+
console.log(' [2] gpt-5.2' + (defaultModel === 'gpt-5.2' ? ' (默认)' : ''));
|
|
111
|
+
console.log(' [3] gpt-5.2-codex' + (defaultModel === 'gpt-5.2-codex' ? ' (默认)' : ''));
|
|
112
|
+
console.log(' [4] gpt-5.3-codex' + (defaultModel === 'gpt-5.3-codex' ? ' (默认)' : ''));
|
|
113
|
+
console.log(' [5] 自定义模型名称' + (!knownModels.includes(defaultModel) ? ' (默认: ' + defaultModel + ')' : ''));
|
|
113
114
|
|
|
114
|
-
const choice = await askQuestion(rl, '请选择 [1/2/3/4]: ');
|
|
115
|
+
const choice = await askQuestion(rl, '请选择 [1/2/3/4/5]: ');
|
|
115
116
|
|
|
116
117
|
if (choice === '2') {
|
|
117
|
-
options.modelName = 'gpt-5.
|
|
118
|
+
options.modelName = 'gpt-5.2';
|
|
118
119
|
} else if (choice === '3') {
|
|
119
|
-
options.modelName = '
|
|
120
|
+
options.modelName = 'gpt-5.2-codex';
|
|
120
121
|
} else if (choice === '4') {
|
|
122
|
+
options.modelName = 'gpt-5.3-codex';
|
|
123
|
+
} else if (choice === '5') {
|
|
121
124
|
const customModel = await askQuestion(rl, '请输入自定义模型名称: ');
|
|
122
125
|
options.modelName = customModel || defaultModel;
|
|
123
126
|
} else if (choice === '1' || choice === '') {
|
package/commands/usage.js
CHANGED
|
@@ -318,6 +318,21 @@ function formatDurationMinutes(value) {
|
|
|
318
318
|
return `${human} (${minuteText} 分钟)`;
|
|
319
319
|
}
|
|
320
320
|
|
|
321
|
+
function formatNumber(value) {
|
|
322
|
+
const n = asNumber(value);
|
|
323
|
+
if (n === null) return '-';
|
|
324
|
+
return n.toLocaleString('en-US');
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
function formatCompactNumber(value) {
|
|
328
|
+
const n = asNumber(value);
|
|
329
|
+
if (n === null) return '-';
|
|
330
|
+
if (n >= 1e9) return `${(n / 1e9).toFixed(2)}B`;
|
|
331
|
+
if (n >= 1e6) return `${(n / 1e6).toFixed(1)}M`;
|
|
332
|
+
if (n >= 1e3) return `${(n / 1e3).toFixed(1)}K`;
|
|
333
|
+
return String(n);
|
|
334
|
+
}
|
|
335
|
+
|
|
321
336
|
function renderBar(current, limit, width = 18) {
|
|
322
337
|
const c = asNumber(current);
|
|
323
338
|
const l = asNumber(limit);
|
|
@@ -419,6 +434,10 @@ function displayUsageStats(stats, origin, source) {
|
|
|
419
434
|
return l - c;
|
|
420
435
|
})();
|
|
421
436
|
|
|
437
|
+
// 提取窗口请求次数和 Token 用量
|
|
438
|
+
const currentWindowRequests = (stats.currentWindowRequests !== undefined) ? stats.currentWindowRequests : limits.currentWindowRequests;
|
|
439
|
+
const currentWindowTokens = (stats.currentWindowTokens !== undefined) ? stats.currentWindowTokens : limits.currentWindowTokens;
|
|
440
|
+
|
|
422
441
|
console.log(`域名: ${origin}`);
|
|
423
442
|
console.log(`来源: ${source}`);
|
|
424
443
|
console.log('');
|
|
@@ -438,6 +457,12 @@ function displayUsageStats(stats, origin, source) {
|
|
|
438
457
|
if (windowRemaining !== null) {
|
|
439
458
|
console.log(`窗口剩余: ${formatCost(windowRemaining)}`);
|
|
440
459
|
}
|
|
460
|
+
if (asNumber(currentWindowRequests) !== null || asNumber(currentWindowTokens) !== null) {
|
|
461
|
+
const parts = [];
|
|
462
|
+
if (asNumber(currentWindowRequests) !== null) parts.push(`请求 ${formatNumber(currentWindowRequests)} 次`);
|
|
463
|
+
if (asNumber(currentWindowTokens) !== null) parts.push(`Token ${formatNumber(currentWindowTokens)}`);
|
|
464
|
+
console.log(`窗口统计: ${parts.join(' | ')}`);
|
|
465
|
+
}
|
|
441
466
|
const windowStartText = formatDateTime(windowStartTime);
|
|
442
467
|
const windowEndText = formatDateTime(windowEndTime);
|
|
443
468
|
if (windowStartText !== '-' || windowEndText !== '-') {
|
|
@@ -457,6 +482,7 @@ function displayUsageStats(stats, origin, source) {
|
|
|
457
482
|
if (resetCountdownText !== '-') {
|
|
458
483
|
console.log(`窗口剩余时间: ${resetCountdownText} (距重置)`);
|
|
459
484
|
}
|
|
485
|
+
|
|
460
486
|
console.log('');
|
|
461
487
|
}
|
|
462
488
|
|