@vybestack/llxprt-code-auth 0.10.0-nightly.260613.1adad3b34
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/dist/.last_build +0 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/src/auth-precedence-resolver.d.ts +147 -0
- package/dist/src/auth-precedence-resolver.js +542 -0
- package/dist/src/auth-precedence-resolver.js.map +1 -0
- package/dist/src/flows/anthropic-device-flow.d.ts +57 -0
- package/dist/src/flows/anthropic-device-flow.js +231 -0
- package/dist/src/flows/anthropic-device-flow.js.map +1 -0
- package/dist/src/flows/codex-device-flow.d.ts +114 -0
- package/dist/src/flows/codex-device-flow.js +437 -0
- package/dist/src/flows/codex-device-flow.js.map +1 -0
- package/dist/src/flows/qwen-device-flow.d.ts +45 -0
- package/dist/src/flows/qwen-device-flow.js +183 -0
- package/dist/src/flows/qwen-device-flow.js.map +1 -0
- package/dist/src/index.d.ts +34 -0
- package/dist/src/index.js +26 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/interfaces/debug-logger.d.ts +31 -0
- package/dist/src/interfaces/debug-logger.js +6 -0
- package/dist/src/interfaces/debug-logger.js.map +1 -0
- package/dist/src/interfaces/index.d.ts +18 -0
- package/dist/src/interfaces/index.js +10 -0
- package/dist/src/interfaces/index.js.map +1 -0
- package/dist/src/interfaces/provider-key-storage.d.ts +26 -0
- package/dist/src/interfaces/provider-key-storage.js +6 -0
- package/dist/src/interfaces/provider-key-storage.js.map +1 -0
- package/dist/src/interfaces/runtime-context.d.ts +37 -0
- package/dist/src/interfaces/runtime-context.js +6 -0
- package/dist/src/interfaces/runtime-context.js.map +1 -0
- package/dist/src/interfaces/secure-store.d.ts +47 -0
- package/dist/src/interfaces/secure-store.js +6 -0
- package/dist/src/interfaces/secure-store.js.map +1 -0
- package/dist/src/interfaces/settings-service.d.ts +25 -0
- package/dist/src/interfaces/settings-service.js +6 -0
- package/dist/src/interfaces/settings-service.js.map +1 -0
- package/dist/src/keyring-token-store.d.ts +96 -0
- package/dist/src/keyring-token-store.js +391 -0
- package/dist/src/keyring-token-store.js.map +1 -0
- package/dist/src/oauth-errors.d.ts +173 -0
- package/dist/src/oauth-errors.js +465 -0
- package/dist/src/oauth-errors.js.map +1 -0
- package/dist/src/precedence.d.ts +115 -0
- package/dist/src/precedence.js +278 -0
- package/dist/src/precedence.js.map +1 -0
- package/dist/src/proxy/framing.d.ts +35 -0
- package/dist/src/proxy/framing.js +86 -0
- package/dist/src/proxy/framing.js.map +1 -0
- package/dist/src/proxy/proxy-provider-key-storage.d.ts +23 -0
- package/dist/src/proxy/proxy-provider-key-storage.js +41 -0
- package/dist/src/proxy/proxy-provider-key-storage.js.map +1 -0
- package/dist/src/proxy/proxy-socket-client.d.ts +43 -0
- package/dist/src/proxy/proxy-socket-client.js +219 -0
- package/dist/src/proxy/proxy-socket-client.js.map +1 -0
- package/dist/src/proxy/proxy-token-store.d.ts +39 -0
- package/dist/src/proxy/proxy-token-store.js +87 -0
- package/dist/src/proxy/proxy-token-store.js.map +1 -0
- package/dist/src/token-merge.d.ts +16 -0
- package/dist/src/token-merge.js +13 -0
- package/dist/src/token-merge.js.map +1 -0
- package/dist/src/token-sanitization.d.ts +16 -0
- package/dist/src/token-sanitization.js +10 -0
- package/dist/src/token-sanitization.js.map +1 -0
- package/dist/src/token-store.d.ts +93 -0
- package/dist/src/token-store.js +7 -0
- package/dist/src/token-store.js.map +1 -0
- package/dist/src/types.d.ts +204 -0
- package/dist/src/types.js +86 -0
- package/dist/src/types.js.map +1 -0
- package/package.json +42 -0
package/dist/.last_build
ADDED
|
File without changes
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Vybestack LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { ISettingsService } from './interfaces/settings-service.js';
|
|
7
|
+
import type { GetActiveRuntimeContext } from './interfaces/runtime-context.js';
|
|
8
|
+
import type { IDebugLogger } from './interfaces/debug-logger.js';
|
|
9
|
+
import type { IProviderKeyStorage } from './interfaces/provider-key-storage.js';
|
|
10
|
+
import type { AuthPrecedenceConfig, OAuthManager } from './precedence.js';
|
|
11
|
+
interface ResolveAuthOptions {
|
|
12
|
+
settingsService?: ISettingsService | null;
|
|
13
|
+
includeOAuth?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare class AuthPrecedenceResolver {
|
|
16
|
+
private static readonly NO_OP_LOGGER;
|
|
17
|
+
private config;
|
|
18
|
+
private oauthManager?;
|
|
19
|
+
private settingsService?;
|
|
20
|
+
private providerKeyStorage?;
|
|
21
|
+
private logger;
|
|
22
|
+
private getActiveRuntimeContextFn?;
|
|
23
|
+
/**
|
|
24
|
+
* Constructs an AuthPrecedenceResolver.
|
|
25
|
+
*
|
|
26
|
+
* If callers expect resolveAuthentication() to resolve named auth keys itself,
|
|
27
|
+
* providerKeyStorage must be injected. CLI profile handling normally resolves
|
|
28
|
+
* named keys to concrete provider apiKey values before provider construction;
|
|
29
|
+
* direct consumers should pass providerKeyStorage or use core's
|
|
30
|
+
* createAuthPrecedenceResolver() factory.
|
|
31
|
+
*/
|
|
32
|
+
constructor(config: AuthPrecedenceConfig, options?: {
|
|
33
|
+
oauthManager?: OAuthManager;
|
|
34
|
+
settingsService?: ISettingsService;
|
|
35
|
+
providerKeyStorage?: IProviderKeyStorage;
|
|
36
|
+
logger?: IDebugLogger;
|
|
37
|
+
getActiveRuntimeContext?: GetActiveRuntimeContext;
|
|
38
|
+
});
|
|
39
|
+
/**
|
|
40
|
+
* @plan PLAN-20251018-STATELESSPROVIDER2.P06
|
|
41
|
+
* @requirement REQ-SP2-001
|
|
42
|
+
* @pseudocode base-provider-call-contract.md lines 1-2
|
|
43
|
+
*/
|
|
44
|
+
setSettingsService(settingsService: ISettingsService | null | undefined): void;
|
|
45
|
+
/**
|
|
46
|
+
* Get the active runtime context via injected function.
|
|
47
|
+
* Returns null if no function was injected or if it returns null/undefined.
|
|
48
|
+
*/
|
|
49
|
+
private getActiveRuntimeContext;
|
|
50
|
+
/**
|
|
51
|
+
* @plan PLAN-20251018-STATELESSPROVIDER2.P06
|
|
52
|
+
* @requirement REQ-SP2-001
|
|
53
|
+
* @pseudocode base-provider-call-contract.md lines 1-2
|
|
54
|
+
*/
|
|
55
|
+
private resolveSettingsService;
|
|
56
|
+
/**
|
|
57
|
+
* @plan PLAN-20251018-STATELESSPROVIDER2.P06
|
|
58
|
+
* @requirement REQ-SP2-001
|
|
59
|
+
* @pseudocode base-provider-call-contract.md lines 1-3
|
|
60
|
+
* Resolves authentication using the full precedence chain
|
|
61
|
+
* Returns the first available authentication method or null if none found
|
|
62
|
+
*/
|
|
63
|
+
resolveAuthentication(options?: ResolveAuthOptions): Promise<string | null>;
|
|
64
|
+
private resolveNonOAuthAuthentication;
|
|
65
|
+
private resolveDirectAuthentication;
|
|
66
|
+
private resolveProviderAuthentication;
|
|
67
|
+
private resolveGlobalAuthentication;
|
|
68
|
+
private resolveKeyFileAuth;
|
|
69
|
+
private resolveEnvironmentAuthentication;
|
|
70
|
+
private canResolveOAuth;
|
|
71
|
+
private resolveOAuthAuthentication;
|
|
72
|
+
private buildOAuthContext;
|
|
73
|
+
private tryGetRuntimeState;
|
|
74
|
+
private isOAuthDisabledByManager;
|
|
75
|
+
private debugOAuthEnablementError;
|
|
76
|
+
private invalidateDisabledOAuthEntry;
|
|
77
|
+
private getCachedOAuthToken;
|
|
78
|
+
private fetchAndCacheOAuthToken;
|
|
79
|
+
private buildOAuthRequestMetadata;
|
|
80
|
+
private extractRuntimeMetadata;
|
|
81
|
+
private storeOAuthTokenMetadata;
|
|
82
|
+
private tryGetOAuthTokenMetadata;
|
|
83
|
+
private debugOAuthTokenError;
|
|
84
|
+
/**
|
|
85
|
+
* @plan PLAN-20251018-STATELESSPROVIDER2.P06
|
|
86
|
+
* @requirement REQ-SP2-001
|
|
87
|
+
* @pseudocode base-provider-call-contract.md lines 1-3
|
|
88
|
+
* Check if any authentication method is available without triggering OAuth
|
|
89
|
+
*/
|
|
90
|
+
hasNonOAuthAuthentication(options?: ResolveAuthOptions): Promise<boolean>;
|
|
91
|
+
/**
|
|
92
|
+
* @plan PLAN-20251018-STATELESSPROVIDER2.P06
|
|
93
|
+
* @requirement REQ-SP2-001
|
|
94
|
+
* @pseudocode base-provider-call-contract.md lines 1-3
|
|
95
|
+
* Check if OAuth is the only available authentication method
|
|
96
|
+
*/
|
|
97
|
+
isOAuthOnlyAvailable(options?: ResolveAuthOptions): Promise<boolean>;
|
|
98
|
+
/**
|
|
99
|
+
* @plan PLAN-20251018-STATELESSPROVIDER2.P06
|
|
100
|
+
* @requirement REQ-SP2-001
|
|
101
|
+
* @pseudocode base-provider-call-contract.md lines 1-3
|
|
102
|
+
* Get authentication method name for debugging/logging
|
|
103
|
+
*/
|
|
104
|
+
getAuthMethodName(options?: ResolveAuthOptions): Promise<string | null>;
|
|
105
|
+
private getGlobalAuthMethodName;
|
|
106
|
+
private getKeyFileMethodName;
|
|
107
|
+
private getConfigAuthMethodName;
|
|
108
|
+
private getEnvironmentAuthMethodName;
|
|
109
|
+
private getOAuthMethodName;
|
|
110
|
+
private normalizeAuthValue;
|
|
111
|
+
private normalizeProviderId;
|
|
112
|
+
private resolveProviderIdentifier;
|
|
113
|
+
private shouldUseGlobalAuth;
|
|
114
|
+
private resolveNamedKey;
|
|
115
|
+
/**
|
|
116
|
+
* Reads API key from a file path, handling tilde expansion, absolute and relative paths
|
|
117
|
+
*/
|
|
118
|
+
private readKeyFile;
|
|
119
|
+
/**
|
|
120
|
+
* Updates the configuration
|
|
121
|
+
*/
|
|
122
|
+
updateConfig(newConfig: Partial<AuthPrecedenceConfig>): void;
|
|
123
|
+
/**
|
|
124
|
+
* Updates the OAuth manager
|
|
125
|
+
*/
|
|
126
|
+
updateOAuthManager(oauthManager: OAuthManager): void;
|
|
127
|
+
/**
|
|
128
|
+
* Invalidates the cached OAuth tokens for this resolver.
|
|
129
|
+
* This should be called during logout to ensure fresh tokens are fetched
|
|
130
|
+
* on the next authentication attempt.
|
|
131
|
+
*
|
|
132
|
+
* @plan PLAN-20251023-STATELESS-HARDENING
|
|
133
|
+
* @requirement Issue #975 - OAuth logout cache invalidation
|
|
134
|
+
*/
|
|
135
|
+
invalidateCache(): void;
|
|
136
|
+
/**
|
|
137
|
+
* Invalidates cached OAuth tokens for a specific provider.
|
|
138
|
+
* This enables surgical cache invalidation for a single provider rather than
|
|
139
|
+
* the all-or-nothing invalidateCache() behavior.
|
|
140
|
+
*
|
|
141
|
+
* @param providerId - The provider ID to invalidate cache entries for
|
|
142
|
+
* @param profileId - Optional profile ID to invalidate only that specific profile
|
|
143
|
+
* @fix issue1861 - Token revocation handling
|
|
144
|
+
*/
|
|
145
|
+
invalidateProviderCache(providerId: string, profileId?: string): void;
|
|
146
|
+
}
|
|
147
|
+
export {};
|