@goodandready/dsh-key-rotation 0.8.54 → 0.8.55
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/CHANGELOG.md +9 -0
- package/lib/model-quota.js +0 -11
- package/lib/ops-status.js +1 -0
- package/lib/pool.js +0 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.8.55 - 2026-10-11
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- **Cleaned Dead Exports and Test-Only Smells (#471)**:
|
|
7
|
+
- Removed unwired exports `getModelTokenUsage` and `getModelTokenRemaining` from `lib/model-quota.js`. Internal logic and status routes use `getModelQuotaStatus(pool, ref, now)`.
|
|
8
|
+
- Removed test-only export `isSoftFailureCode` from `lib/pool.js`.
|
|
9
|
+
- Wired `activeModelPools` into `/dsh-key-rotation/status` response keys object as `modelPools`.
|
|
10
|
+
- Cleaned dead-export and test references across the repository.
|
|
11
|
+
|
|
3
12
|
## 0.8.54 - 2026-10-11
|
|
4
13
|
|
|
5
14
|
### Added
|
package/lib/model-quota.js
CHANGED
|
@@ -139,18 +139,7 @@ function readQuota(pool, ref, quotaResetWindow, now) {
|
|
|
139
139
|
return { used, resetAt, open: true, stored: true };
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
/** Tokens consumed by `ref` in `pool` during the current window (0 = none/unlimited). */
|
|
143
|
-
export function getModelTokenUsage(pool, ref, now) {
|
|
144
|
-
if (getModelTokenLimit(pool, ref) === null) return 0;
|
|
145
|
-
return readQuota(pool, ref, undefined, now).used;
|
|
146
|
-
}
|
|
147
142
|
|
|
148
|
-
/** Remaining tokens, or null when the credential is unlimited in this pool. */
|
|
149
|
-
export function getModelTokenRemaining(pool, ref, now) {
|
|
150
|
-
const limit = getModelTokenLimit(pool, ref);
|
|
151
|
-
if (limit === null) return null;
|
|
152
|
-
return Math.max(0, limit - readQuota(pool, ref, undefined, now).used);
|
|
153
|
-
}
|
|
154
143
|
|
|
155
144
|
/**
|
|
156
145
|
* Quota status for one credential in one model pool (status/health APIs).
|
package/lib/ops-status.js
CHANGED
|
@@ -119,6 +119,7 @@ ctx.effect(() => ctx.webServer.register({
|
|
|
119
119
|
paused: isKeyPaused(pool, ref),
|
|
120
120
|
revoked: isKeyRevoked(pool, ref),
|
|
121
121
|
modelQuota,
|
|
122
|
+
modelPools: activeModelPools.map(mp => mp.base),
|
|
122
123
|
});
|
|
123
124
|
}
|
|
124
125
|
const basePool = pool.basePool ?? (runtime.index ? basePoolForBase(runtime.index, pool.base) : null);
|
package/lib/pool.js
CHANGED
|
@@ -96,11 +96,6 @@ export const SOFT_FAILURE_CODES = new Set([
|
|
|
96
96
|
'SERVER', 'TIMEOUT', 'TRANSPORT', 'EMPTY_RESPONSE', '500', '502', '503', '504',
|
|
97
97
|
]);
|
|
98
98
|
|
|
99
|
-
/** True if failure code or message represents a soft/transient drop. */
|
|
100
|
-
export function isSoftFailureCode(code) {
|
|
101
|
-
if (!code) return false;
|
|
102
|
-
return SOFT_FAILURE_CODES.has(String(code).toUpperCase());
|
|
103
|
-
}
|
|
104
99
|
|
|
105
100
|
/** Ref name validator. Same rule lib/index.js enforces in PUT/DELETE /key. */
|
|
106
101
|
const REF_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goodandready/dsh-key-rotation",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.55",
|
|
4
4
|
"packageManager": "pnpm@10.33.2",
|
|
5
5
|
"description": "Per-provider API key rotation for DeepSeek Harness: a key pool per provider, auto-created clone routes, and switching to the next key on quota/rate-limit errors. Includes a Settings section (Key Rotation) to edit the key pools, cooldown and switch codes.",
|
|
6
6
|
"keywords": [
|