@vybestack/llxprt-code-core 0.1.23 → 0.2.2-nightly.250908.fb8099b7
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/README.md +21 -17
- package/dist/src/adapters/IStreamAdapter.d.ts +3 -3
- package/dist/src/auth/oauth-errors.d.ts +173 -0
- package/dist/src/auth/oauth-errors.js +461 -0
- package/dist/src/auth/oauth-errors.js.map +1 -0
- package/dist/src/auth/precedence.d.ts +1 -5
- package/dist/src/auth/precedence.js +28 -48
- package/dist/src/auth/precedence.js.map +1 -1
- package/dist/src/auth/token-store.js +2 -2
- package/dist/src/auth/token-store.js.map +1 -1
- package/dist/src/auth/types.d.ts +4 -4
- package/dist/src/code_assist/codeAssist.js +19 -6
- package/dist/src/code_assist/codeAssist.js.map +1 -1
- package/dist/src/code_assist/oauth2.d.ts +7 -0
- package/dist/src/code_assist/oauth2.js +82 -32
- package/dist/src/code_assist/oauth2.js.map +1 -1
- package/dist/src/code_assist/server.js +15 -4
- package/dist/src/code_assist/server.js.map +1 -1
- package/dist/src/code_assist/setup.js +9 -0
- package/dist/src/code_assist/setup.js.map +1 -1
- package/dist/src/config/index.d.ts +7 -0
- package/dist/src/config/index.js +8 -0
- package/dist/src/config/index.js.map +1 -0
- package/dist/src/core/client.d.ts +15 -20
- package/dist/src/core/client.js +98 -124
- package/dist/src/core/client.js.map +1 -1
- package/dist/src/core/compression-config.d.ts +10 -0
- package/dist/src/core/compression-config.js +17 -0
- package/dist/src/core/compression-config.js.map +1 -0
- package/dist/src/core/coreToolScheduler.js +50 -15
- package/dist/src/core/coreToolScheduler.js.map +1 -1
- package/dist/src/core/geminiChat.d.ts +68 -9
- package/dist/src/core/geminiChat.js +940 -405
- package/dist/src/core/geminiChat.js.map +1 -1
- package/dist/src/core/nonInteractiveToolExecutor.js +70 -19
- package/dist/src/core/nonInteractiveToolExecutor.js.map +1 -1
- package/dist/src/core/prompts.js +35 -25
- package/dist/src/core/prompts.js.map +1 -1
- package/dist/src/core/turn.d.ts +1 -0
- package/dist/src/core/turn.js +8 -6
- package/dist/src/core/turn.js.map +1 -1
- package/dist/src/ide/ide-client.d.ts +1 -1
- package/dist/src/ide/ide-client.js +12 -6
- package/dist/src/ide/ide-client.js.map +1 -1
- package/dist/src/index.d.ts +4 -2
- package/dist/src/index.js +5 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/prompt-config/TemplateEngine.js +17 -0
- package/dist/src/prompt-config/TemplateEngine.js.map +1 -1
- package/dist/src/prompt-config/defaults/core-defaults.js +39 -32
- package/dist/src/prompt-config/defaults/core-defaults.js.map +1 -1
- package/dist/src/prompt-config/defaults/core.md +2 -0
- package/dist/src/prompt-config/defaults/provider-defaults.js +34 -27
- package/dist/src/prompt-config/defaults/provider-defaults.js.map +1 -1
- package/dist/src/prompt-config/defaults/providers/gemini/core.md +270 -0
- package/dist/src/prompt-config/defaults/providers/gemini/models/gemini-2.5-flash/core.md +12 -0
- package/dist/src/prompt-config/defaults/providers/gemini/models/gemini-2.5-flash/gemini-2-5-flash/core.md +12 -0
- package/dist/src/prompt-config/types.d.ts +2 -0
- package/dist/src/providers/BaseProvider.d.ts +39 -13
- package/dist/src/providers/BaseProvider.js +102 -28
- package/dist/src/providers/BaseProvider.js.map +1 -1
- package/dist/src/providers/IProvider.d.ts +17 -3
- package/dist/src/providers/LoggingProviderWrapper.d.ts +10 -3
- package/dist/src/providers/LoggingProviderWrapper.js +33 -27
- package/dist/src/providers/LoggingProviderWrapper.js.map +1 -1
- package/dist/src/providers/ProviderContentGenerator.d.ts +2 -2
- package/dist/src/providers/ProviderContentGenerator.js +9 -6
- package/dist/src/providers/ProviderContentGenerator.js.map +1 -1
- package/dist/src/providers/ProviderManager.d.ts +4 -0
- package/dist/src/providers/ProviderManager.js +6 -0
- package/dist/src/providers/ProviderManager.js.map +1 -1
- package/dist/src/providers/anthropic/AnthropicProvider.d.ts +34 -21
- package/dist/src/providers/anthropic/AnthropicProvider.js +505 -492
- package/dist/src/providers/anthropic/AnthropicProvider.js.map +1 -1
- package/dist/src/providers/gemini/GeminiProvider.d.ts +23 -9
- package/dist/src/providers/gemini/GeminiProvider.js +344 -515
- package/dist/src/providers/gemini/GeminiProvider.js.map +1 -1
- package/dist/src/providers/openai/ConversationCache.d.ts +3 -3
- package/dist/src/providers/openai/IChatGenerateParams.d.ts +9 -4
- package/dist/src/providers/openai/OpenAIProvider.d.ts +46 -96
- package/dist/src/providers/openai/OpenAIProvider.js +532 -1393
- package/dist/src/providers/openai/OpenAIProvider.js.map +1 -1
- package/dist/src/providers/openai/buildResponsesRequest.d.ts +3 -3
- package/dist/src/providers/openai/buildResponsesRequest.js +67 -37
- package/dist/src/providers/openai/buildResponsesRequest.js.map +1 -1
- package/dist/src/providers/openai/estimateRemoteTokens.d.ts +2 -2
- package/dist/src/providers/openai/estimateRemoteTokens.js +21 -8
- package/dist/src/providers/openai/estimateRemoteTokens.js.map +1 -1
- package/dist/src/providers/openai/parseResponsesStream.d.ts +6 -2
- package/dist/src/providers/openai/parseResponsesStream.js +99 -391
- package/dist/src/providers/openai/parseResponsesStream.js.map +1 -1
- package/dist/src/providers/openai/syntheticToolResponses.d.ts +5 -5
- package/dist/src/providers/openai/syntheticToolResponses.js +102 -91
- package/dist/src/providers/openai/syntheticToolResponses.js.map +1 -1
- package/dist/src/providers/openai-responses/OpenAIResponsesProvider.d.ts +89 -0
- package/dist/src/providers/openai-responses/OpenAIResponsesProvider.js +451 -0
- package/dist/src/providers/openai-responses/OpenAIResponsesProvider.js.map +1 -0
- package/dist/src/providers/openai-responses/index.d.ts +1 -0
- package/dist/src/providers/openai-responses/index.js +2 -0
- package/dist/src/providers/openai-responses/index.js.map +1 -0
- package/dist/src/providers/tokenizers/OpenAITokenizer.js +3 -3
- package/dist/src/providers/tokenizers/OpenAITokenizer.js.map +1 -1
- package/dist/src/providers/types.d.ts +1 -1
- package/dist/src/services/ClipboardService.d.ts +19 -0
- package/dist/src/services/ClipboardService.js +66 -0
- package/dist/src/services/ClipboardService.js.map +1 -0
- package/dist/src/services/history/ContentConverters.d.ts +43 -0
- package/dist/src/services/history/ContentConverters.js +325 -0
- package/dist/src/services/history/ContentConverters.js.map +1 -0
- package/dist/src/{providers/IMessage.d.ts → services/history/HistoryEvents.d.ts} +16 -22
- package/dist/src/{providers/IMessage.js → services/history/HistoryEvents.js} +1 -1
- package/dist/src/services/history/HistoryEvents.js.map +1 -0
- package/dist/src/services/history/HistoryService.d.ts +220 -0
- package/dist/src/services/history/HistoryService.js +673 -0
- package/dist/src/services/history/HistoryService.js.map +1 -0
- package/dist/src/services/history/IContent.d.ts +183 -0
- package/dist/src/services/history/IContent.js +104 -0
- package/dist/src/services/history/IContent.js.map +1 -0
- package/dist/src/services/index.d.ts +1 -0
- package/dist/src/services/index.js +1 -0
- package/dist/src/services/index.js.map +1 -1
- package/dist/src/telemetry/types.d.ts +16 -4
- package/dist/src/telemetry/types.js.map +1 -1
- package/dist/src/tools/IToolFormatter.d.ts +2 -2
- package/dist/src/tools/ToolFormatter.d.ts +42 -4
- package/dist/src/tools/ToolFormatter.js +159 -37
- package/dist/src/tools/ToolFormatter.js.map +1 -1
- package/dist/src/tools/doubleEscapeUtils.d.ts +57 -0
- package/dist/src/tools/doubleEscapeUtils.js +241 -0
- package/dist/src/tools/doubleEscapeUtils.js.map +1 -0
- package/dist/src/tools/read-file.d.ts +6 -1
- package/dist/src/tools/read-file.js +25 -11
- package/dist/src/tools/read-file.js.map +1 -1
- package/dist/src/tools/todo-schemas.d.ts +4 -4
- package/dist/src/tools/tools.js +13 -0
- package/dist/src/tools/tools.js.map +1 -1
- package/dist/src/tools/write-file.d.ts +6 -1
- package/dist/src/tools/write-file.js +48 -26
- package/dist/src/tools/write-file.js.map +1 -1
- package/dist/src/types/modelParams.d.ts +8 -0
- package/dist/src/utils/bfsFileSearch.js +2 -6
- package/dist/src/utils/bfsFileSearch.js.map +1 -1
- package/dist/src/utils/schemaValidator.js +16 -1
- package/dist/src/utils/schemaValidator.js.map +1 -1
- package/package.json +8 -7
- package/dist/src/providers/IMessage.js.map +0 -1
- package/dist/src/providers/adapters/GeminiCompatibleWrapper.d.ts +0 -69
- package/dist/src/providers/adapters/GeminiCompatibleWrapper.js +0 -577
- package/dist/src/providers/adapters/GeminiCompatibleWrapper.js.map +0 -1
package/README.md
CHANGED
@@ -47,21 +47,6 @@ You have two options to install LLxprt Code.
|
|
47
47
|
npx https://github.com/acoliver/llxprt-code
|
48
48
|
```
|
49
49
|
|
50
|
-
### With Homebrew
|
51
|
-
|
52
|
-
1. **Prerequisites:** Ensure you have [Homebrew](https://brew.sh/) installed.
|
53
|
-
2. **Install the CLI:** Execute the following command in your terminal:
|
54
|
-
|
55
|
-
```bash
|
56
|
-
brew install llxprt-code
|
57
|
-
```
|
58
|
-
|
59
|
-
Then, run the CLI from anywhere:
|
60
|
-
|
61
|
-
```bash
|
62
|
-
llxprt
|
63
|
-
```
|
64
|
-
|
65
50
|
### Common Configuration Steps
|
66
51
|
|
67
52
|
3. **Run and configure:**
|
@@ -127,10 +112,10 @@ Access Qwen3-Coder-Pro and other Qwen models for free:
|
|
127
112
|
Use OAuth authentication to access Qwen with your free account:
|
128
113
|
|
129
114
|
```
|
130
|
-
/auth qwen
|
115
|
+
/auth qwen enable
|
131
116
|
```
|
132
117
|
|
133
|
-
|
118
|
+
This enables OAuth for Qwen. When you send your first message, your browser will automatically open to the Qwen authentication page. Log in and authorize LLxprt Code - the authentication will complete automatically and your request will be processed. You're now using Qwen3-Coder-Pro for free!
|
134
119
|
|
135
120
|
#### Option 2: Use an API Key
|
136
121
|
|
@@ -144,6 +129,25 @@ For advanced users who need API access:
|
|
144
129
|
/model qwen3-coder-pro
|
145
130
|
```
|
146
131
|
|
132
|
+
### Using Cerebras Code Max/Pro
|
133
|
+
|
134
|
+
Access Cerebras Code Max/Pro plan with the powerful qwen-3-coder-480b model:
|
135
|
+
|
136
|
+
1. Get your API key from [Cerebras](https://cloud.cerebras.ai/)
|
137
|
+
2. Configure LLxprt Code:
|
138
|
+
```
|
139
|
+
/provider openai
|
140
|
+
/baseurl https://api.cerebras.ai/v1
|
141
|
+
/key your-cerebras-api-key
|
142
|
+
/model qwen-3-coder-480b
|
143
|
+
```
|
144
|
+
|
145
|
+
For optimal performance with this model, consider setting a high context limit:
|
146
|
+
|
147
|
+
```
|
148
|
+
/set context-limit 100000
|
149
|
+
```
|
150
|
+
|
147
151
|
### Using Local Models
|
148
152
|
|
149
153
|
Run models locally for complete privacy and control. LLxprt Code works with any OpenAI-compatible server.
|
@@ -3,7 +3,7 @@
|
|
3
3
|
* Copyright 2025 Vybestack LLC
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
5
5
|
*/
|
6
|
-
import {
|
6
|
+
import { IContent } from '../services/history/IContent.js';
|
7
7
|
import { ServerGeminiStreamEvent } from '../core/turn.js';
|
8
8
|
/**
|
9
9
|
* Interface for adapting provider-specific streams to Gemini event format
|
@@ -11,8 +11,8 @@ import { ServerGeminiStreamEvent } from '../core/turn.js';
|
|
11
11
|
export interface IStreamAdapter {
|
12
12
|
/**
|
13
13
|
* Adapts a provider's stream format to Gemini's event stream format
|
14
|
-
* @param providerStream The provider-specific stream of
|
14
|
+
* @param providerStream The provider-specific stream of content
|
15
15
|
* @returns An async iterator of Gemini events
|
16
16
|
*/
|
17
|
-
adaptStream(providerStream: AsyncIterableIterator<
|
17
|
+
adaptStream(providerStream: AsyncIterableIterator<IContent>): AsyncIterableIterator<ServerGeminiStreamEvent>;
|
18
18
|
}
|
@@ -0,0 +1,173 @@
|
|
1
|
+
/**
|
2
|
+
* @license
|
3
|
+
* Copyright 2025 Vybestack LLC
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
5
|
+
*/
|
6
|
+
/**
|
7
|
+
* OAuth Error Handling System
|
8
|
+
*
|
9
|
+
* Provides comprehensive error classification, user-friendly messaging,
|
10
|
+
* and recovery mechanisms for OAuth providers.
|
11
|
+
*/
|
12
|
+
/**
|
13
|
+
* OAuth error categories for classification and handling
|
14
|
+
*/
|
15
|
+
export declare enum OAuthErrorCategory {
|
16
|
+
/** User must take action (re-authenticate, grant permissions) */
|
17
|
+
USER_ACTION_REQUIRED = "user_action_required",
|
18
|
+
/** Network or temporary service issues that can be retried */
|
19
|
+
TRANSIENT = "transient",
|
20
|
+
/** System issues (file permissions, storage problems) */
|
21
|
+
SYSTEM = "system",
|
22
|
+
/** Critical security or data corruption issues */
|
23
|
+
CRITICAL = "critical",
|
24
|
+
/** Configuration or setup problems */
|
25
|
+
CONFIGURATION = "configuration"
|
26
|
+
}
|
27
|
+
/**
|
28
|
+
* Specific OAuth error types with detailed classification
|
29
|
+
*/
|
30
|
+
export declare enum OAuthErrorType {
|
31
|
+
AUTHENTICATION_REQUIRED = "authentication_required",
|
32
|
+
AUTHORIZATION_EXPIRED = "authorization_expired",
|
33
|
+
INSUFFICIENT_PERMISSIONS = "insufficient_permissions",
|
34
|
+
USER_CANCELLED = "user_cancelled",
|
35
|
+
INVALID_CREDENTIALS = "invalid_credentials",
|
36
|
+
NETWORK_ERROR = "network_error",
|
37
|
+
SERVICE_UNAVAILABLE = "service_unavailable",
|
38
|
+
RATE_LIMITED = "rate_limited",
|
39
|
+
TIMEOUT = "timeout",
|
40
|
+
STORAGE_ERROR = "storage_error",
|
41
|
+
FILE_PERMISSIONS = "file_permissions",
|
42
|
+
CORRUPTED_DATA = "corrupted_data",
|
43
|
+
SECURITY_VIOLATION = "security_violation",
|
44
|
+
MALFORMED_TOKEN = "malformed_token",
|
45
|
+
INVALID_CLIENT_ID = "invalid_client_id",
|
46
|
+
INVALID_ENDPOINT = "invalid_endpoint",
|
47
|
+
MISSING_CONFIGURATION = "missing_configuration",
|
48
|
+
UNKNOWN = "unknown"
|
49
|
+
}
|
50
|
+
/**
|
51
|
+
* Retry strategy configuration
|
52
|
+
*/
|
53
|
+
export interface RetryConfig {
|
54
|
+
/** Maximum number of retry attempts */
|
55
|
+
maxAttempts: number;
|
56
|
+
/** Base delay between retries in milliseconds */
|
57
|
+
baseDelayMs: number;
|
58
|
+
/** Multiplier for exponential backoff */
|
59
|
+
backoffMultiplier: number;
|
60
|
+
/** Maximum delay between retries in milliseconds */
|
61
|
+
maxDelayMs: number;
|
62
|
+
/** Whether to add random jitter to delays */
|
63
|
+
jitter: boolean;
|
64
|
+
}
|
65
|
+
/**
|
66
|
+
* Default retry configuration for transient errors
|
67
|
+
*/
|
68
|
+
export declare const DEFAULT_RETRY_CONFIG: RetryConfig;
|
69
|
+
/**
|
70
|
+
* Comprehensive OAuth error with classification and user guidance
|
71
|
+
*/
|
72
|
+
export declare class OAuthError extends Error {
|
73
|
+
readonly category: OAuthErrorCategory;
|
74
|
+
readonly type: OAuthErrorType;
|
75
|
+
readonly provider: string;
|
76
|
+
readonly userMessage: string;
|
77
|
+
readonly actionRequired: string | null;
|
78
|
+
readonly isRetryable: boolean;
|
79
|
+
readonly retryAfterMs: number | null;
|
80
|
+
readonly technicalDetails: Record<string, unknown>;
|
81
|
+
readonly originalError: Error | null;
|
82
|
+
constructor(type: OAuthErrorType, provider: string, message: string, options?: {
|
83
|
+
userMessage?: string;
|
84
|
+
actionRequired?: string;
|
85
|
+
retryAfterMs?: number;
|
86
|
+
technicalDetails?: Record<string, unknown>;
|
87
|
+
originalError?: Error;
|
88
|
+
cause?: Error;
|
89
|
+
});
|
90
|
+
/**
|
91
|
+
* Categorizes error type into handling categories
|
92
|
+
*/
|
93
|
+
private categorizeError;
|
94
|
+
/**
|
95
|
+
* Determines if error type is retryable
|
96
|
+
*/
|
97
|
+
private determineRetryability;
|
98
|
+
/**
|
99
|
+
* Generates user-friendly error message
|
100
|
+
*/
|
101
|
+
private generateUserMessage;
|
102
|
+
/**
|
103
|
+
* Generates actionable guidance for users
|
104
|
+
*/
|
105
|
+
private generateActionRequired;
|
106
|
+
/**
|
107
|
+
* Creates a sanitized version of the error for logging
|
108
|
+
*/
|
109
|
+
toLogEntry(): Record<string, unknown>;
|
110
|
+
}
|
111
|
+
/**
|
112
|
+
* Error factory for common OAuth error scenarios
|
113
|
+
*/
|
114
|
+
export declare class OAuthErrorFactory {
|
115
|
+
/**
|
116
|
+
* Creates an authentication required error
|
117
|
+
*/
|
118
|
+
static authenticationRequired(provider: string, details?: Record<string, unknown>): OAuthError;
|
119
|
+
/**
|
120
|
+
* Creates an expired authorization error
|
121
|
+
*/
|
122
|
+
static authorizationExpired(provider: string, details?: Record<string, unknown>): OAuthError;
|
123
|
+
/**
|
124
|
+
* Creates a network error with retry capability
|
125
|
+
*/
|
126
|
+
static networkError(provider: string, originalError?: Error, details?: Record<string, unknown>): OAuthError;
|
127
|
+
/**
|
128
|
+
* Creates a rate limited error with specific retry delay
|
129
|
+
*/
|
130
|
+
static rateLimited(provider: string, retryAfterSeconds?: number, details?: Record<string, unknown>): OAuthError;
|
131
|
+
/**
|
132
|
+
* Creates a storage error
|
133
|
+
*/
|
134
|
+
static storageError(provider: string, originalError?: Error, details?: Record<string, unknown>): OAuthError;
|
135
|
+
/**
|
136
|
+
* Creates a corrupted data error
|
137
|
+
*/
|
138
|
+
static corruptedData(provider: string, details?: Record<string, unknown>): OAuthError;
|
139
|
+
/**
|
140
|
+
* Creates an error from an unknown error, attempting classification
|
141
|
+
*/
|
142
|
+
static fromUnknown(provider: string, error: unknown, context?: string): OAuthError;
|
143
|
+
}
|
144
|
+
/**
|
145
|
+
* Retry handler with exponential backoff and jitter
|
146
|
+
*/
|
147
|
+
export declare class RetryHandler {
|
148
|
+
private config;
|
149
|
+
constructor(config?: RetryConfig);
|
150
|
+
/**
|
151
|
+
* Executes operation with retry logic for transient errors
|
152
|
+
*/
|
153
|
+
executeWithRetry<T>(operation: () => Promise<T>, provider: string, context?: string): Promise<T>;
|
154
|
+
/**
|
155
|
+
* Sleep utility
|
156
|
+
*/
|
157
|
+
private sleep;
|
158
|
+
}
|
159
|
+
/**
|
160
|
+
* Graceful error handler for OAuth operations
|
161
|
+
*/
|
162
|
+
export declare class GracefulErrorHandler {
|
163
|
+
private retryHandler;
|
164
|
+
constructor(retryHandler?: RetryHandler);
|
165
|
+
/**
|
166
|
+
* Handles errors gracefully, providing fallback behavior when possible
|
167
|
+
*/
|
168
|
+
handleGracefully<T>(operation: () => Promise<T>, fallback: T | (() => T | Promise<T>), provider: string, context?: string): Promise<T>;
|
169
|
+
/**
|
170
|
+
* Wraps a method to handle errors gracefully with logging
|
171
|
+
*/
|
172
|
+
wrapMethod<TArgs extends unknown[], TReturn>(method: (...args: TArgs) => Promise<TReturn>, provider: string, methodName: string, fallback?: TReturn | ((...args: TArgs) => TReturn | Promise<TReturn>)): (...args: TArgs) => Promise<TReturn>;
|
173
|
+
}
|