dsh-keys-manager 0.4.4 → 0.4.6
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 +19 -0
- package/README.md +12 -28
- package/README.zh-CN.md +8 -8
- package/lib/client/format.d.ts +1 -1
- package/lib/client.js +2 -2
- package/lib/core.d.ts +6 -0
- package/lib/core.js +6 -0
- package/lib/core.js.map +1 -1
- package/lib/domain.d.ts +3 -3
- package/lib/extra-capabilities.generated.d.ts +1 -1
- package/lib/extra-capabilities.generated.js +760 -250
- package/lib/extra-capabilities.generated.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +9 -13
- package/lib/index.js.map +1 -1
- package/lib/omp-oauth/oauth.mjs +192 -38
- package/lib/quota/providers.d.ts +13 -11
- package/lib/quota/providers.js +28 -22
- package/lib/quota/providers.js.map +1 -1
- package/package.json +5 -5
- package/scripts/verify-install.mjs +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -9,8 +9,8 @@ export declare const provide: string[];
|
|
|
9
9
|
export declare const OAUTH_GRANT_RECORD_SCOPE = "llm-pi-ai";
|
|
10
10
|
/**
|
|
11
11
|
* The credential-record scope the llm-omp transports package owns: one
|
|
12
|
-
* `llm-omp-transports/<route>` grant per transport route (
|
|
13
|
-
* `
|
|
12
|
+
* `llm-omp-transports/<route>` grant per transport route (devin's key is
|
|
13
|
+
* `llm-omp-transports/devin`). Keys Manager reads
|
|
14
14
|
* those records to list/verify an account and deletes one on removal; it
|
|
15
15
|
* never writes one and never projects one into `llm-pi-ai/<provider>`, so a
|
|
16
16
|
* transport route keeps serving from its own adapter-owned credential.
|
package/lib/index.js
CHANGED
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
17
17
|
import { createHash, randomBytes } from 'node:crypto';
|
|
18
|
-
import { CURSOR_ROUTE, cursorCatalogModels } from 'dsh-llm-omp-transports';
|
|
19
18
|
import * as transportModule from 'dsh-llm-omp-transports';
|
|
20
19
|
import { mergeModelCapabilities, repairModelCapabilities as repairModelRows, sanitizeReasoningEfforts } from './capabilities.js';
|
|
21
20
|
import { KEY_LIMIT, TEST_SUCCESS_FINISH_KINDS, accountRef, applyFailureCooldown, bindingKey, classifyOAuthFailure, isSelectable, markKeySuccess, markKeyUsed, normalizeSettings, patchSettings, pickHealthyExcluding, pickRoundRobin, quotaRank, rankCandidates, shouldFailover, statusOfKey, statusOfProvider, validateKeyInput, validateKeyPatch, } from './core.js';
|
|
@@ -71,8 +70,8 @@ const INTENTIONAL_REMOVAL_TTL_MS = 5_000;
|
|
|
71
70
|
export const OAUTH_GRANT_RECORD_SCOPE = 'llm-pi-ai';
|
|
72
71
|
/**
|
|
73
72
|
* The credential-record scope the llm-omp transports package owns: one
|
|
74
|
-
* `llm-omp-transports/<route>` grant per transport route (
|
|
75
|
-
* `
|
|
73
|
+
* `llm-omp-transports/<route>` grant per transport route (devin's key is
|
|
74
|
+
* `llm-omp-transports/devin`). Keys Manager reads
|
|
76
75
|
* those records to list/verify an account and deletes one on removal; it
|
|
77
76
|
* never writes one and never projects one into `llm-pi-ai/<provider>`, so a
|
|
78
77
|
* transport route keeps serving from its own adapter-owned credential.
|
|
@@ -584,8 +583,8 @@ function transportAccountOf(flow, record, now) {
|
|
|
584
583
|
const status = grant === undefined
|
|
585
584
|
? record === undefined ? 'signed-out' : 'needs-reauth'
|
|
586
585
|
: grant.expires === undefined
|
|
587
|
-
// Only the devin resolver serves an expiry-less record;
|
|
588
|
-
// dated grant
|
|
586
|
+
// Only the devin resolver serves an expiry-less record; the other routes
|
|
587
|
+
// need a dated grant, so there the row is not usable.
|
|
589
588
|
? route === DEVIN_ROUTE ? 'active' : 'needs-reauth'
|
|
590
589
|
: grant.expires > now
|
|
591
590
|
? 'active'
|
|
@@ -618,10 +617,10 @@ const DEVIN_ROUTE = 'devin';
|
|
|
618
617
|
/**
|
|
619
618
|
* The catalog accessor each transport route ships in the transports package.
|
|
620
619
|
*
|
|
621
|
-
* One exported function per route, the `
|
|
622
|
-
*
|
|
623
|
-
*
|
|
624
|
-
*
|
|
620
|
+
* One exported function per route, the `devinCatalogModels` shape. An installed
|
|
621
|
+
* transport build may predate a route's export (every route added after the
|
|
622
|
+
* installed build, including the Google pair, `factory-droid` and the GitLab
|
|
623
|
+
* pair), so a probe can legitimately find nothing.
|
|
625
624
|
*/
|
|
626
625
|
/**
|
|
627
626
|
* The catalog *refresh* accessor a transport route may ship.
|
|
@@ -636,8 +635,7 @@ const TRANSPORT_CATALOG_REFRESH = Object.freeze({
|
|
|
636
635
|
});
|
|
637
636
|
const TRANSPORT_CATALOG_EXPORTS = Object.freeze({
|
|
638
637
|
[DEVIN_ROUTE]: 'devinCatalogModels',
|
|
639
|
-
'
|
|
640
|
-
'google-antigravity': 'googleAntigravityCatalogModels',
|
|
638
|
+
'antigravity-cli': 'antigravityCliCatalogModels',
|
|
641
639
|
'factory-droid': 'factoryDroidCatalogModels',
|
|
642
640
|
'gitlab-duo': 'gitlabDuoCatalogModels',
|
|
643
641
|
'gitlab-duo-agent': 'gitlabDuoAgentCatalogModels',
|
|
@@ -655,8 +653,6 @@ const TRANSPORT_CATALOG_EXPORTS = Object.freeze({
|
|
|
655
653
|
* silent `[]`.
|
|
656
654
|
*/
|
|
657
655
|
function transportCatalogOf(route, onMissing) {
|
|
658
|
-
if (route === CURSOR_ROUTE)
|
|
659
|
-
return cursorCatalogModels();
|
|
660
656
|
// Own keys only: a prototype-colliding id ("toString") must take the
|
|
661
657
|
// missing-catalog path, not read an inherited value as an export name.
|
|
662
658
|
const exportName = Object.hasOwn(TRANSPORT_CATALOG_EXPORTS, route) ? TRANSPORT_CATALOG_EXPORTS[route] : undefined;
|