@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.
Files changed (71) hide show
  1. package/dist/.last_build +0 -0
  2. package/dist/index.d.ts +10 -0
  3. package/dist/index.js +11 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/src/auth-precedence-resolver.d.ts +147 -0
  6. package/dist/src/auth-precedence-resolver.js +542 -0
  7. package/dist/src/auth-precedence-resolver.js.map +1 -0
  8. package/dist/src/flows/anthropic-device-flow.d.ts +57 -0
  9. package/dist/src/flows/anthropic-device-flow.js +231 -0
  10. package/dist/src/flows/anthropic-device-flow.js.map +1 -0
  11. package/dist/src/flows/codex-device-flow.d.ts +114 -0
  12. package/dist/src/flows/codex-device-flow.js +437 -0
  13. package/dist/src/flows/codex-device-flow.js.map +1 -0
  14. package/dist/src/flows/qwen-device-flow.d.ts +45 -0
  15. package/dist/src/flows/qwen-device-flow.js +183 -0
  16. package/dist/src/flows/qwen-device-flow.js.map +1 -0
  17. package/dist/src/index.d.ts +34 -0
  18. package/dist/src/index.js +26 -0
  19. package/dist/src/index.js.map +1 -0
  20. package/dist/src/interfaces/debug-logger.d.ts +31 -0
  21. package/dist/src/interfaces/debug-logger.js +6 -0
  22. package/dist/src/interfaces/debug-logger.js.map +1 -0
  23. package/dist/src/interfaces/index.d.ts +18 -0
  24. package/dist/src/interfaces/index.js +10 -0
  25. package/dist/src/interfaces/index.js.map +1 -0
  26. package/dist/src/interfaces/provider-key-storage.d.ts +26 -0
  27. package/dist/src/interfaces/provider-key-storage.js +6 -0
  28. package/dist/src/interfaces/provider-key-storage.js.map +1 -0
  29. package/dist/src/interfaces/runtime-context.d.ts +37 -0
  30. package/dist/src/interfaces/runtime-context.js +6 -0
  31. package/dist/src/interfaces/runtime-context.js.map +1 -0
  32. package/dist/src/interfaces/secure-store.d.ts +47 -0
  33. package/dist/src/interfaces/secure-store.js +6 -0
  34. package/dist/src/interfaces/secure-store.js.map +1 -0
  35. package/dist/src/interfaces/settings-service.d.ts +25 -0
  36. package/dist/src/interfaces/settings-service.js +6 -0
  37. package/dist/src/interfaces/settings-service.js.map +1 -0
  38. package/dist/src/keyring-token-store.d.ts +96 -0
  39. package/dist/src/keyring-token-store.js +391 -0
  40. package/dist/src/keyring-token-store.js.map +1 -0
  41. package/dist/src/oauth-errors.d.ts +173 -0
  42. package/dist/src/oauth-errors.js +465 -0
  43. package/dist/src/oauth-errors.js.map +1 -0
  44. package/dist/src/precedence.d.ts +115 -0
  45. package/dist/src/precedence.js +278 -0
  46. package/dist/src/precedence.js.map +1 -0
  47. package/dist/src/proxy/framing.d.ts +35 -0
  48. package/dist/src/proxy/framing.js +86 -0
  49. package/dist/src/proxy/framing.js.map +1 -0
  50. package/dist/src/proxy/proxy-provider-key-storage.d.ts +23 -0
  51. package/dist/src/proxy/proxy-provider-key-storage.js +41 -0
  52. package/dist/src/proxy/proxy-provider-key-storage.js.map +1 -0
  53. package/dist/src/proxy/proxy-socket-client.d.ts +43 -0
  54. package/dist/src/proxy/proxy-socket-client.js +219 -0
  55. package/dist/src/proxy/proxy-socket-client.js.map +1 -0
  56. package/dist/src/proxy/proxy-token-store.d.ts +39 -0
  57. package/dist/src/proxy/proxy-token-store.js +87 -0
  58. package/dist/src/proxy/proxy-token-store.js.map +1 -0
  59. package/dist/src/token-merge.d.ts +16 -0
  60. package/dist/src/token-merge.js +13 -0
  61. package/dist/src/token-merge.js.map +1 -0
  62. package/dist/src/token-sanitization.d.ts +16 -0
  63. package/dist/src/token-sanitization.js +10 -0
  64. package/dist/src/token-sanitization.js.map +1 -0
  65. package/dist/src/token-store.d.ts +93 -0
  66. package/dist/src/token-store.js +7 -0
  67. package/dist/src/token-store.js.map +1 -0
  68. package/dist/src/types.d.ts +204 -0
  69. package/dist/src/types.js +86 -0
  70. package/dist/src/types.js.map +1 -0
  71. package/package.json +42 -0
File without changes
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @plan:PLAN-20260608-ISSUE1586.P03
3
+ * @requirement:REQ-AUTH-001.2
4
+ */
5
+ /**
6
+ * @license
7
+ * Copyright 2025 Google LLC
8
+ * SPDX-License-Identifier: Apache-2.0
9
+ */
10
+ export * from './src/index.js';
package/dist/index.js ADDED
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @plan:PLAN-20260608-ISSUE1586.P03
3
+ * @requirement:REQ-AUTH-001.2
4
+ */
5
+ /**
6
+ * @license
7
+ * Copyright 2025 Google LLC
8
+ * SPDX-License-Identifier: Apache-2.0
9
+ */
10
+ export * from './src/index.js';
11
+ //# sourceMappingURL=index.js.map
@@ -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 {};