aihezu 2.6.1 → 2.6.2
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/usage.js +7 -5
- package/package.json +1 -1
package/commands/usage.js
CHANGED
|
@@ -387,13 +387,15 @@ function displayUsageStats(stats, origin, source) {
|
|
|
387
387
|
return Math.max(0, Math.floor((endMs - Date.now()) / 1000));
|
|
388
388
|
})();
|
|
389
389
|
const windowDurationMinutes = (() => {
|
|
390
|
+
const startMs = normalizeEpochMs(windowStartTime);
|
|
391
|
+
const endMs = normalizeEpochMs(windowEndTime);
|
|
392
|
+
if (startMs !== null && endMs !== null && endMs > startMs) {
|
|
393
|
+
return Math.round((endMs - startMs) / 60000);
|
|
394
|
+
}
|
|
390
395
|
const raw = (stats.rateLimitWindow !== undefined) ? stats.rateLimitWindow : limits.rateLimitWindow;
|
|
391
396
|
const minutes = asNumber(raw);
|
|
392
397
|
if (minutes !== null) return minutes;
|
|
393
|
-
|
|
394
|
-
const endMs = normalizeEpochMs(windowEndTime);
|
|
395
|
-
if (startMs === null || endMs === null || endMs <= startMs) return null;
|
|
396
|
-
return Math.round((endMs - startMs) / 60000);
|
|
398
|
+
return null;
|
|
397
399
|
})();
|
|
398
400
|
|
|
399
401
|
const dailyRemaining = (() => {
|
|
@@ -446,7 +448,7 @@ function displayUsageStats(stats, origin, source) {
|
|
|
446
448
|
}
|
|
447
449
|
const resetCountdownText = formatDurationSeconds(windowRemainingSeconds);
|
|
448
450
|
if (resetCountdownText !== '-') {
|
|
449
|
-
console.log(
|
|
451
|
+
console.log(`窗口剩余时间: ${resetCountdownText} (距重置)`);
|
|
450
452
|
}
|
|
451
453
|
console.log('');
|
|
452
454
|
}
|