@vybestack/llxprt-code 0.1.12 → 0.1.13-nightly.250727.2261021c
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/index.js +0 -0
- package/dist/package.json +5 -5
- package/dist/src/acp/acp.d.ts +208 -0
- package/dist/src/acp/acp.js +193 -0
- package/dist/src/acp/acp.js.map +1 -0
- package/dist/src/acp/acpPeer.d.ts +8 -0
- package/dist/src/acp/acpPeer.js +537 -0
- package/dist/src/acp/acpPeer.js.map +1 -0
- package/dist/src/config/config.d.ts +2 -0
- package/dist/src/config/config.js +73 -19
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/extension.d.ts +2 -2
- package/dist/src/config/extension.js +21 -16
- package/dist/src/config/extension.js.map +1 -1
- package/dist/src/config/settings.d.ts +7 -0
- package/dist/src/config/settings.js +15 -0
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/gemini.js +33 -34
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +1 -1
- package/dist/src/generated/git-commit.js +1 -1
- package/dist/src/nonInteractiveCli.js +36 -3
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/providers/index.d.ts +1 -7
- package/dist/src/providers/index.js +2 -10
- package/dist/src/providers/index.js.map +1 -1
- package/dist/src/providers/providerConfigUtils.d.ts +1 -2
- package/dist/src/providers/providerConfigUtils.js +1 -1
- package/dist/src/providers/providerConfigUtils.js.map +1 -1
- package/dist/src/providers/providerManagerInstance.d.ts +2 -2
- package/dist/src/providers/providerManagerInstance.js +21 -19
- package/dist/src/providers/providerManagerInstance.js.map +1 -1
- package/dist/src/providers/types.d.ts +1 -9
- package/dist/src/providers/types.js +2 -10
- package/dist/src/providers/types.js.map +1 -1
- package/dist/src/services/CommandService.d.ts +3 -1
- package/dist/src/services/CommandService.js +50 -11
- package/dist/src/services/CommandService.js.map +1 -1
- package/dist/src/ui/App.js +24 -25
- package/dist/src/ui/App.js.map +1 -1
- package/dist/src/ui/commands/aboutCommand.js +21 -0
- package/dist/src/ui/commands/aboutCommand.js.map +1 -1
- package/dist/src/ui/commands/baseurlCommand.d.ts +7 -0
- package/dist/src/ui/commands/baseurlCommand.js +22 -0
- package/dist/src/ui/commands/baseurlCommand.js.map +1 -0
- package/dist/src/ui/commands/bugCommand.d.ts +7 -0
- package/dist/src/ui/commands/bugCommand.js +61 -0
- package/dist/src/ui/commands/bugCommand.js.map +1 -0
- package/dist/src/ui/commands/chatCommand.d.ts +7 -0
- package/dist/src/ui/commands/chatCommand.js +170 -0
- package/dist/src/ui/commands/chatCommand.js.map +1 -0
- package/dist/src/ui/commands/clearCommand.js +12 -2
- package/dist/src/ui/commands/clearCommand.js.map +1 -1
- package/dist/src/ui/commands/compressCommand.d.ts +7 -0
- package/dist/src/ui/commands/compressCommand.js +62 -0
- package/dist/src/ui/commands/compressCommand.js.map +1 -0
- package/dist/src/ui/commands/docsCommand.d.ts +7 -0
- package/dist/src/ui/commands/docsCommand.js +29 -0
- package/dist/src/ui/commands/docsCommand.js.map +1 -0
- package/dist/src/ui/commands/editorCommand.d.ts +7 -0
- package/dist/src/ui/commands/editorCommand.js +14 -0
- package/dist/src/ui/commands/editorCommand.js.map +1 -0
- package/dist/src/ui/commands/extensionsCommand.d.ts +7 -0
- package/dist/src/ui/commands/extensionsCommand.js +29 -0
- package/dist/src/ui/commands/extensionsCommand.js.map +1 -0
- package/dist/src/ui/commands/ideCommand.d.ts +8 -0
- package/dist/src/ui/commands/ideCommand.js +123 -0
- package/dist/src/ui/commands/ideCommand.js.map +1 -0
- package/dist/src/{providers/ProviderAwareContentGenerator.d.ts → ui/commands/keyCommand.d.ts} +2 -1
- package/dist/src/ui/commands/keyCommand.js +29 -0
- package/dist/src/ui/commands/keyCommand.js.map +1 -0
- package/dist/src/ui/commands/keyfileCommand.d.ts +7 -0
- package/dist/src/ui/commands/keyfileCommand.js +104 -0
- package/dist/src/ui/commands/keyfileCommand.js.map +1 -0
- package/dist/src/ui/commands/mcpCommand.d.ts +7 -0
- package/dist/src/ui/commands/mcpCommand.js +204 -0
- package/dist/src/ui/commands/mcpCommand.js.map +1 -0
- package/dist/src/ui/commands/modelCommand.d.ts +7 -0
- package/dist/src/ui/commands/modelCommand.js +60 -0
- package/dist/src/ui/commands/modelCommand.js.map +1 -0
- package/dist/src/ui/commands/providerCommand.d.ts +7 -0
- package/dist/src/ui/commands/providerCommand.js +86 -0
- package/dist/src/ui/commands/providerCommand.js.map +1 -0
- package/dist/src/ui/commands/quitCommand.d.ts +7 -0
- package/dist/src/ui/commands/quitCommand.js +32 -0
- package/dist/src/ui/commands/quitCommand.js.map +1 -0
- package/dist/src/ui/commands/restoreCommand.d.ts +8 -0
- package/dist/src/ui/commands/restoreCommand.js +126 -0
- package/dist/src/ui/commands/restoreCommand.js.map +1 -0
- package/dist/src/ui/commands/statsCommand.d.ts +7 -0
- package/dist/src/ui/commands/statsCommand.js +50 -0
- package/dist/src/ui/commands/statsCommand.js.map +1 -0
- package/dist/src/ui/commands/toolsCommand.d.ts +7 -0
- package/dist/src/ui/commands/toolsCommand.js +54 -0
- package/dist/src/ui/commands/toolsCommand.js.map +1 -0
- package/dist/src/ui/commands/types.d.ts +34 -2
- package/dist/src/ui/components/ContextSummaryDisplay.d.ts +6 -1
- package/dist/src/ui/components/ContextSummaryDisplay.js +46 -19
- package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/Footer.d.ts +0 -1
- package/dist/src/ui/components/Footer.js +3 -21
- package/dist/src/ui/components/Footer.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.js +110 -61
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/ProviderModelDialog.d.ts +1 -1
- package/dist/src/ui/components/ThemeDialog.js +25 -24
- package/dist/src/ui/components/ThemeDialog.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.js +3 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -1
- package/dist/src/ui/components/shared/MaxSizedBox.js +69 -2
- package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +3 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.js +60 -10
- package/dist/src/ui/components/shared/RadioButtonSelect.js.map +1 -1
- package/dist/src/ui/components/shared/text-buffer.js +1 -1
- package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
- package/dist/src/ui/constants.d.ts +1 -0
- package/dist/src/ui/constants.js +1 -0
- package/dist/src/ui/constants.js.map +1 -1
- package/dist/src/ui/containers/SessionController.js +1 -1
- package/dist/src/ui/containers/SessionController.js.map +1 -1
- package/dist/src/ui/contexts/OpenAIProviderContext.d.ts +1 -2
- package/dist/src/ui/contexts/OpenAIProviderContext.js.map +1 -1
- package/dist/src/ui/hooks/shellCommandProcessor.d.ts +1 -1
- package/dist/src/ui/hooks/shellCommandProcessor.js +35 -11
- package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +2 -9
- package/dist/src/ui/hooks/slashCommandProcessor.js +83 -622
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/useAuthCommand.js +16 -2
- package/dist/src/ui/hooks/useAuthCommand.js.map +1 -1
- package/dist/src/ui/hooks/useCompletion.d.ts +1 -0
- package/dist/src/ui/hooks/useCompletion.js +21 -2
- package/dist/src/ui/hooks/useCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useFocus.d.ts +6 -0
- package/dist/src/ui/hooks/useFocus.js +41 -0
- package/dist/src/ui/hooks/useFocus.js.map +1 -0
- package/dist/src/ui/hooks/useGeminiStream.js +34 -2
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useOpenAIProviderInfo.d.ts +3 -2
- package/dist/src/ui/hooks/useOpenAIProviderInfo.js +5 -4
- package/dist/src/ui/hooks/useOpenAIProviderInfo.js.map +1 -1
- package/dist/src/ui/hooks/usePrivacySettings.js +5 -5
- package/dist/src/ui/hooks/usePrivacySettings.js.map +1 -1
- package/dist/src/ui/hooks/useProviderDialog.d.ts +5 -2
- package/dist/src/ui/hooks/useProviderDialog.js +55 -3
- package/dist/src/ui/hooks/useProviderDialog.js.map +1 -1
- package/dist/src/ui/hooks/useProviderModelDialog.d.ts +1 -1
- package/dist/src/ui/themes/ansi-light.js +1 -1
- package/dist/src/ui/themes/ansi-light.js.map +1 -1
- package/dist/src/ui/themes/googlecode.js +1 -1
- package/dist/src/ui/themes/googlecode.js.map +1 -1
- package/dist/src/ui/themes/xcode.js +1 -1
- package/dist/src/ui/themes/xcode.js.map +1 -1
- package/dist/src/ui/types.d.ts +10 -0
- package/dist/src/ui/types.js.map +1 -1
- package/dist/src/ui/utils/updateCheck.js +10 -6
- package/dist/src/ui/utils/updateCheck.js.map +1 -1
- package/dist/src/utils/userStartupWarnings.js +1 -16
- package/dist/src/utils/userStartupWarnings.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/dist/src/providers/IMessage.d.ts +0 -38
- package/dist/src/providers/IMessage.js +0 -17
- package/dist/src/providers/IMessage.js.map +0 -1
- package/dist/src/providers/IModel.d.ts +0 -23
- package/dist/src/providers/IModel.js +0 -17
- package/dist/src/providers/IModel.js.map +0 -1
- package/dist/src/providers/IProvider.d.ts +0 -32
- package/dist/src/providers/IProvider.js +0 -17
- package/dist/src/providers/IProvider.js.map +0 -1
- package/dist/src/providers/ITool.d.ts +0 -23
- package/dist/src/providers/ITool.js +0 -17
- package/dist/src/providers/ITool.js.map +0 -1
- package/dist/src/providers/ProviderAwareContentGenerator.js +0 -9
- package/dist/src/providers/ProviderAwareContentGenerator.js.map +0 -1
- package/dist/src/providers/ProviderManager.d.ts +0 -19
- package/dist/src/providers/ProviderManager.js +0 -63
- package/dist/src/providers/ProviderManager.js.map +0 -1
- package/dist/src/providers/ProviderManagerAdapter.d.ts +0 -17
- package/dist/src/providers/ProviderManagerAdapter.js +0 -113
- package/dist/src/providers/ProviderManagerAdapter.js.map +0 -1
- package/dist/src/providers/README-qwen3.md +0 -60
- package/dist/src/providers/adapters/IStreamAdapter.d.ts +0 -18
- package/dist/src/providers/adapters/IStreamAdapter.js +0 -7
- package/dist/src/providers/adapters/IStreamAdapter.js.map +0 -1
- package/dist/src/providers/anthropic/AnthropicProvider.d.ts +0 -46
- package/dist/src/providers/anthropic/AnthropicProvider.js +0 -478
- package/dist/src/providers/anthropic/AnthropicProvider.js.map +0 -1
- package/dist/src/providers/contentGeneratorProvider.d.ts +0 -13
- package/dist/src/providers/contentGeneratorProvider.js +0 -17
- package/dist/src/providers/contentGeneratorProvider.js.map +0 -1
- package/dist/src/providers/gemini/GeminiProvider.d.ts +0 -72
- package/dist/src/providers/gemini/GeminiProvider.js +0 -454
- package/dist/src/providers/gemini/GeminiProvider.js.map +0 -1
- package/dist/src/providers/integration/TEST_INSTRUCTIONS.md +0 -197
- package/dist/src/providers/openai/ConversationCache.d.ts +0 -20
- package/dist/src/providers/openai/ConversationCache.js +0 -109
- package/dist/src/providers/openai/ConversationCache.js.map +0 -1
- package/dist/src/providers/openai/IChatGenerateParams.d.ts +0 -11
- package/dist/src/providers/openai/IChatGenerateParams.js +0 -2
- package/dist/src/providers/openai/IChatGenerateParams.js.map +0 -1
- package/dist/src/providers/openai/OpenAIProvider.d.ts +0 -71
- package/dist/src/providers/openai/OpenAIProvider.js +0 -486
- package/dist/src/providers/openai/OpenAIProvider.js.map +0 -1
- package/dist/src/providers/openai/Qwen3FireworksProvider.d.ts +0 -39
- package/dist/src/providers/openai/Qwen3FireworksProvider.js +0 -209
- package/dist/src/providers/openai/Qwen3FireworksProvider.js.map +0 -1
- package/dist/src/providers/openai/RESPONSES_API_MODELS.d.ts +0 -2
- package/dist/src/providers/openai/RESPONSES_API_MODELS.js +0 -14
- package/dist/src/providers/openai/RESPONSES_API_MODELS.js.map +0 -1
- package/dist/src/providers/openai/buildResponsesRequest.d.ts +0 -67
- package/dist/src/providers/openai/buildResponsesRequest.js +0 -144
- package/dist/src/providers/openai/buildResponsesRequest.js.map +0 -1
- package/dist/src/providers/openai/docs/accessing-provider-info.md +0 -172
- package/dist/src/providers/openai/docs/params-mapping.md +0 -91
- package/dist/src/providers/openai/docs/qwen3-fireworks.md +0 -47
- package/dist/src/providers/openai/docs/responses-api-tool-calls.md +0 -96
- package/dist/src/providers/openai/estimateRemoteTokens.d.ts +0 -26
- package/dist/src/providers/openai/estimateRemoteTokens.js +0 -75
- package/dist/src/providers/openai/estimateRemoteTokens.js.map +0 -1
- package/dist/src/providers/openai/getOpenAIProviderInfo.d.ts +0 -46
- package/dist/src/providers/openai/getOpenAIProviderInfo.js +0 -74
- package/dist/src/providers/openai/getOpenAIProviderInfo.js.map +0 -1
- package/dist/src/providers/openai/parseResponsesStream.d.ts +0 -3
- package/dist/src/providers/openai/parseResponsesStream.js +0 -444
- package/dist/src/providers/openai/parseResponsesStream.js.map +0 -1
- package/dist/src/providers/parsers/TextToolCallParser.d.ts +0 -35
- package/dist/src/providers/parsers/TextToolCallParser.js +0 -248
- package/dist/src/providers/parsers/TextToolCallParser.js.map +0 -1
- package/dist/src/providers/tokenizers/AnthropicTokenizer.d.ts +0 -19
- package/dist/src/providers/tokenizers/AnthropicTokenizer.js +0 -37
- package/dist/src/providers/tokenizers/AnthropicTokenizer.js.map +0 -1
- package/dist/src/providers/tokenizers/ITokenizer.d.ts +0 -18
- package/dist/src/providers/tokenizers/ITokenizer.js +0 -17
- package/dist/src/providers/tokenizers/ITokenizer.js.map +0 -1
- package/dist/src/providers/tokenizers/OpenAITokenizer.d.ts +0 -24
- package/dist/src/providers/tokenizers/OpenAITokenizer.js +0 -56
- package/dist/src/providers/tokenizers/OpenAITokenizer.js.map +0 -1
- package/dist/src/tools/IToolFormatter.d.ts +0 -40
- package/dist/src/tools/IToolFormatter.js +0 -17
- package/dist/src/tools/IToolFormatter.js.map +0 -1
- package/dist/src/tools/ToolFormatter.d.ts +0 -45
- package/dist/src/tools/ToolFormatter.js +0 -216
- package/dist/src/tools/ToolFormatter.js.map +0 -1
- package/dist/vybestack-llxprt-code-0.1.12.tgz +0 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vybestack/llxprt-code",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.13-nightly.250727.2261021c",
|
4
4
|
"description": "LLxprt Code",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -8,6 +8,7 @@
|
|
8
8
|
},
|
9
9
|
"type": "module",
|
10
10
|
"main": "dist/index.js",
|
11
|
+
"types": "dist/index.d.ts",
|
11
12
|
"bin": {
|
12
13
|
"llxprt": "dist/index.js"
|
13
14
|
},
|
@@ -32,19 +33,18 @@
|
|
32
33
|
"dist"
|
33
34
|
],
|
34
35
|
"config": {
|
35
|
-
"sandboxImageUri": "ghcr.io/acoliver/llxprt-code/sandbox:0.1.
|
36
|
+
"sandboxImageUri": "ghcr.io/acoliver/llxprt-code/sandbox:0.1.13-nightly.250727.2261021c"
|
36
37
|
},
|
37
38
|
"dependencies": {
|
38
39
|
"@anthropic-ai/sdk": "^0.55.1",
|
39
40
|
"@dqbd/tiktoken": "^1.0.21",
|
40
41
|
"@google/genai": "^1.8.0",
|
41
42
|
"@types/update-notifier": "^6.0.8",
|
42
|
-
"@vybestack/llxprt-code-core": "0.1.
|
43
|
+
"@vybestack/llxprt-code-core": "0.1.13-nightly.250727.2261021c",
|
43
44
|
"chalk": "^5.3.0",
|
44
45
|
"command-exists": "^1.2.9",
|
45
46
|
"diff": "^7.0.0",
|
46
47
|
"dotenv": "^17.1.0",
|
47
|
-
"gaxios": "^7.1.1",
|
48
48
|
"glob": "^10.4.1",
|
49
49
|
"highlight.js": "^11.11.1",
|
50
50
|
"ink": "^6.0.1",
|
@@ -64,7 +64,7 @@
|
|
64
64
|
"strip-ansi": "^7.1.0",
|
65
65
|
"strip-json-comments": "^3.1.1",
|
66
66
|
"update-notifier": "^7.3.1",
|
67
|
-
"yargs": "^
|
67
|
+
"yargs": "^17.7.2"
|
68
68
|
},
|
69
69
|
"devDependencies": {
|
70
70
|
"@babel/runtime": "^7.27.6",
|
@@ -1,38 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright 2025 Vybestack LLC
|
3
|
-
*
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
* you may not use this file except in compliance with the License.
|
6
|
-
* You may obtain a copy of the License at
|
7
|
-
*
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
*
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
* See the License for the specific language governing permissions and
|
14
|
-
* limitations under the License.
|
15
|
-
*/
|
16
|
-
import { ContentGeneratorRole } from './types.js';
|
17
|
-
import { Part } from '@google/genai';
|
18
|
-
export interface IMessage {
|
19
|
-
id?: string;
|
20
|
-
role: ContentGeneratorRole | 'system';
|
21
|
-
content: string;
|
22
|
-
parts?: Part[];
|
23
|
-
tool_call_id?: string;
|
24
|
-
tool_name?: string;
|
25
|
-
tool_calls?: Array<{
|
26
|
-
id: string;
|
27
|
-
type: 'function';
|
28
|
-
function: {
|
29
|
-
name: string;
|
30
|
-
arguments: string;
|
31
|
-
};
|
32
|
-
}>;
|
33
|
-
usage?: {
|
34
|
-
prompt_tokens: number;
|
35
|
-
completion_tokens: number;
|
36
|
-
total_tokens: number;
|
37
|
-
};
|
38
|
-
}
|
@@ -1,17 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright 2025 Vybestack LLC
|
3
|
-
*
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
* you may not use this file except in compliance with the License.
|
6
|
-
* You may obtain a copy of the License at
|
7
|
-
*
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
*
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
* See the License for the specific language governing permissions and
|
14
|
-
* limitations under the License.
|
15
|
-
*/
|
16
|
-
export {};
|
17
|
-
//# sourceMappingURL=IMessage.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"IMessage.js","sourceRoot":"","sources":["../../../src/providers/IMessage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"}
|
@@ -1,23 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright 2025 Vybestack LLC
|
3
|
-
*
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
* you may not use this file except in compliance with the License.
|
6
|
-
* You may obtain a copy of the License at
|
7
|
-
*
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
*
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
* See the License for the specific language governing permissions and
|
14
|
-
* limitations under the License.
|
15
|
-
*/
|
16
|
-
export interface IModel {
|
17
|
-
id: string;
|
18
|
-
name: string;
|
19
|
-
provider: string;
|
20
|
-
supportedToolFormats: string[];
|
21
|
-
contextWindow?: number;
|
22
|
-
maxOutputTokens?: number;
|
23
|
-
}
|
@@ -1,17 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright 2025 Vybestack LLC
|
3
|
-
*
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
* you may not use this file except in compliance with the License.
|
6
|
-
* You may obtain a copy of the License at
|
7
|
-
*
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
*
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
* See the License for the specific language governing permissions and
|
14
|
-
* limitations under the License.
|
15
|
-
*/
|
16
|
-
export {};
|
17
|
-
//# sourceMappingURL=IModel.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"IModel.js","sourceRoot":"","sources":["../../../src/providers/IModel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"}
|
@@ -1,32 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright 2025 Vybestack LLC
|
3
|
-
*
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
* you may not use this file except in compliance with the License.
|
6
|
-
* You may obtain a copy of the License at
|
7
|
-
*
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
*
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
* See the License for the specific language governing permissions and
|
14
|
-
* limitations under the License.
|
15
|
-
*/
|
16
|
-
import { IModel } from './IModel.js';
|
17
|
-
import { ITool } from './ITool.js';
|
18
|
-
import { IMessage } from './IMessage.js';
|
19
|
-
export interface IProvider {
|
20
|
-
name: string;
|
21
|
-
isDefault?: boolean;
|
22
|
-
getModels(): Promise<IModel[]>;
|
23
|
-
generateChatCompletion(messages: IMessage[], tools?: ITool[], toolFormat?: string): AsyncIterableIterator<unknown>;
|
24
|
-
setModel?(modelId: string): void;
|
25
|
-
getCurrentModel?(): string;
|
26
|
-
setApiKey?(apiKey: string): void;
|
27
|
-
setBaseUrl?(baseUrl?: string): void;
|
28
|
-
getToolFormat?(): string;
|
29
|
-
setToolFormatOverride?(format: string | null): void;
|
30
|
-
isPaidMode?(): boolean;
|
31
|
-
}
|
32
|
-
export type { IModel, ITool, IMessage };
|
@@ -1,17 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright 2025 Vybestack LLC
|
3
|
-
*
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
* you may not use this file except in compliance with the License.
|
6
|
-
* You may obtain a copy of the License at
|
7
|
-
*
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
*
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
* See the License for the specific language governing permissions and
|
14
|
-
* limitations under the License.
|
15
|
-
*/
|
16
|
-
export {};
|
17
|
-
//# sourceMappingURL=IProvider.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"IProvider.js","sourceRoot":"","sources":["../../../src/providers/IProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"}
|
@@ -1,23 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright 2025 Vybestack LLC
|
3
|
-
*
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
* you may not use this file except in compliance with the License.
|
6
|
-
* You may obtain a copy of the License at
|
7
|
-
*
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
*
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
* See the License for the specific language governing permissions and
|
14
|
-
* limitations under the License.
|
15
|
-
*/
|
16
|
-
export interface ITool {
|
17
|
-
type: 'function';
|
18
|
-
function: {
|
19
|
-
name: string;
|
20
|
-
description?: string;
|
21
|
-
parameters: object;
|
22
|
-
};
|
23
|
-
}
|
@@ -1,17 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright 2025 Vybestack LLC
|
3
|
-
*
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
* you may not use this file except in compliance with the License.
|
6
|
-
* You may obtain a copy of the License at
|
7
|
-
*
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
*
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
* See the License for the specific language governing permissions and
|
14
|
-
* limitations under the License.
|
15
|
-
*/
|
16
|
-
export {};
|
17
|
-
//# sourceMappingURL=ITool.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ITool.js","sourceRoot":"","sources":["../../../src/providers/ITool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"}
|
@@ -1,9 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license
|
3
|
-
* Copyright 2025 Vybestack LLC
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
5
|
-
*/
|
6
|
-
export {};
|
7
|
-
// This file is kept for backward compatibility
|
8
|
-
// Provider support is now handled in the core package
|
9
|
-
//# sourceMappingURL=ProviderAwareContentGenerator.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ProviderAwareContentGenerator.js","sourceRoot":"","sources":["../../../src/providers/ProviderAwareContentGenerator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,+CAA+C;AAC/C,sDAAsD"}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license
|
3
|
-
* Copyright 2025 Vybestack LLC
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
5
|
-
*/
|
6
|
-
import { IProvider, IModel } from './IProvider.js';
|
7
|
-
export declare class ProviderManager {
|
8
|
-
private providers;
|
9
|
-
private activeProviderName;
|
10
|
-
constructor();
|
11
|
-
registerProvider(provider: IProvider): void;
|
12
|
-
setActiveProvider(name: string): void;
|
13
|
-
clearActiveProvider(): void;
|
14
|
-
getActiveProvider(): IProvider;
|
15
|
-
getAvailableModels(providerName?: string): Promise<IModel[]>;
|
16
|
-
listProviders(): string[];
|
17
|
-
getActiveProviderName(): string;
|
18
|
-
hasActiveProvider(): boolean;
|
19
|
-
}
|
@@ -1,63 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license
|
3
|
-
* Copyright 2025 Vybestack LLC
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
5
|
-
*/
|
6
|
-
export class ProviderManager {
|
7
|
-
providers;
|
8
|
-
activeProviderName;
|
9
|
-
constructor() {
|
10
|
-
this.providers = new Map();
|
11
|
-
this.activeProviderName = ''; // No default provider
|
12
|
-
}
|
13
|
-
registerProvider(provider) {
|
14
|
-
this.providers.set(provider.name, provider);
|
15
|
-
// If this is the default provider and no provider is active, set it as active
|
16
|
-
if (provider.isDefault && !this.activeProviderName) {
|
17
|
-
this.activeProviderName = provider.name;
|
18
|
-
}
|
19
|
-
}
|
20
|
-
setActiveProvider(name) {
|
21
|
-
if (!this.providers.has(name)) {
|
22
|
-
throw new Error('Provider not found');
|
23
|
-
}
|
24
|
-
this.activeProviderName = name;
|
25
|
-
}
|
26
|
-
clearActiveProvider() {
|
27
|
-
this.activeProviderName = '';
|
28
|
-
}
|
29
|
-
getActiveProvider() {
|
30
|
-
if (!this.activeProviderName) {
|
31
|
-
throw new Error('No active provider set');
|
32
|
-
}
|
33
|
-
const provider = this.providers.get(this.activeProviderName);
|
34
|
-
if (!provider) {
|
35
|
-
throw new Error('Active provider not found');
|
36
|
-
}
|
37
|
-
return provider;
|
38
|
-
}
|
39
|
-
async getAvailableModels(providerName) {
|
40
|
-
let provider;
|
41
|
-
if (providerName) {
|
42
|
-
provider = this.providers.get(providerName);
|
43
|
-
if (!provider) {
|
44
|
-
throw new Error(`Provider '${providerName}' not found`);
|
45
|
-
}
|
46
|
-
}
|
47
|
-
else {
|
48
|
-
provider = this.getActiveProvider();
|
49
|
-
}
|
50
|
-
return provider.getModels();
|
51
|
-
}
|
52
|
-
listProviders() {
|
53
|
-
return Array.from(this.providers.keys());
|
54
|
-
}
|
55
|
-
getActiveProviderName() {
|
56
|
-
return this.activeProviderName;
|
57
|
-
}
|
58
|
-
hasActiveProvider() {
|
59
|
-
return (this.activeProviderName !== '' &&
|
60
|
-
this.providers.has(this.activeProviderName));
|
61
|
-
}
|
62
|
-
}
|
63
|
-
//# sourceMappingURL=ProviderManager.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ProviderManager.js","sourceRoot":"","sources":["../../../src/providers/ProviderManager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,OAAO,eAAe;IAClB,SAAS,CAAyB;IAClC,kBAAkB,CAAS;IAEnC;QACE,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,EAAqB,CAAC;QAC9C,IAAI,CAAC,kBAAkB,GAAG,EAAE,CAAC,CAAC,sBAAsB;IACtD,CAAC;IAED,gBAAgB,CAAC,QAAmB;QAClC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAE5C,8EAA8E;QAC9E,IAAI,QAAQ,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAC;YACnD,IAAI,CAAC,kBAAkB,GAAG,QAAQ,CAAC,IAAI,CAAC;QAC1C,CAAC;IACH,CAAC;IAED,iBAAiB,CAAC,IAAY;QAC5B,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;QACxC,CAAC;QACD,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;IACjC,CAAC;IAED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
|
3
|
-
* Copyright 2025 Vybestack LLC
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
5
|
-
*/
|
6
|
-
import { Provider, ProviderManager as CoreProviderManager } from '@vybestack/llxprt-code-core';
|
7
|
-
import { ProviderManager } from './ProviderManager.js';
|
8
|
-
/**
|
9
|
-
* Adapter that makes the CLI's ProviderManager compatible with the core's ProviderManager interface
|
10
|
-
*/
|
11
|
-
export declare class ProviderManagerAdapter implements CoreProviderManager {
|
12
|
-
private cliProviderManager;
|
13
|
-
constructor(cliProviderManager: ProviderManager);
|
14
|
-
hasActiveProvider(): boolean;
|
15
|
-
getActiveProvider(): Provider | null;
|
16
|
-
getActiveProviderName(): string;
|
17
|
-
}
|
@@ -1,113 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license
|
3
|
-
* Copyright 2025 Vybestack LLC
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
5
|
-
*/
|
6
|
-
import { ContentGeneratorRole } from './types.js';
|
7
|
-
/**
|
8
|
-
* Adapter that makes the CLI's ProviderManager compatible with the core's ProviderManager interface
|
9
|
-
*/
|
10
|
-
export class ProviderManagerAdapter {
|
11
|
-
cliProviderManager;
|
12
|
-
constructor(cliProviderManager) {
|
13
|
-
this.cliProviderManager = cliProviderManager;
|
14
|
-
}
|
15
|
-
hasActiveProvider() {
|
16
|
-
return this.cliProviderManager.hasActiveProvider();
|
17
|
-
}
|
18
|
-
getActiveProvider() {
|
19
|
-
const cliProvider = this.cliProviderManager.getActiveProvider();
|
20
|
-
if (!cliProvider)
|
21
|
-
return null;
|
22
|
-
return new ProviderAdapter(cliProvider);
|
23
|
-
}
|
24
|
-
getActiveProviderName() {
|
25
|
-
return this.cliProviderManager.getActiveProviderName();
|
26
|
-
}
|
27
|
-
}
|
28
|
-
/**
|
29
|
-
* Adapter that makes the CLI's IProvider compatible with the core's Provider interface
|
30
|
-
*/
|
31
|
-
class ProviderAdapter {
|
32
|
-
cliProvider;
|
33
|
-
constructor(cliProvider) {
|
34
|
-
this.cliProvider = cliProvider;
|
35
|
-
}
|
36
|
-
get name() {
|
37
|
-
return this.cliProvider.name;
|
38
|
-
}
|
39
|
-
getCurrentModel() {
|
40
|
-
return this.cliProvider.getCurrentModel?.() || 'unknown';
|
41
|
-
}
|
42
|
-
setModel(modelId) {
|
43
|
-
this.cliProvider.setModel?.(modelId);
|
44
|
-
}
|
45
|
-
async *generateChatCompletion(messages, tools) {
|
46
|
-
// Convert core messages to CLI messages
|
47
|
-
const cliMessages = messages.map((msg) => {
|
48
|
-
let role;
|
49
|
-
switch (msg.role) {
|
50
|
-
case 'user':
|
51
|
-
role = ContentGeneratorRole.USER;
|
52
|
-
break;
|
53
|
-
case 'assistant':
|
54
|
-
role = ContentGeneratorRole.ASSISTANT;
|
55
|
-
break;
|
56
|
-
case 'tool':
|
57
|
-
role = ContentGeneratorRole.TOOL;
|
58
|
-
break;
|
59
|
-
case 'system':
|
60
|
-
role = 'system';
|
61
|
-
break;
|
62
|
-
default:
|
63
|
-
throw new Error(`Unknown role: ${msg.role}`);
|
64
|
-
}
|
65
|
-
return {
|
66
|
-
role,
|
67
|
-
content: msg.content,
|
68
|
-
tool_calls: msg.tool_calls,
|
69
|
-
tool_call_id: msg.tool_call_id,
|
70
|
-
parts: 'parts' in msg ? msg.parts : undefined, // Preserve parts field for PDFs/images
|
71
|
-
};
|
72
|
-
});
|
73
|
-
// Convert core tools to CLI tools
|
74
|
-
const cliTools = tools?.map((tool) => ({
|
75
|
-
type: tool.type,
|
76
|
-
function: {
|
77
|
-
...tool.function,
|
78
|
-
parameters: tool.function.parameters || {},
|
79
|
-
},
|
80
|
-
}));
|
81
|
-
// Generate and convert responses
|
82
|
-
for await (const cliMessage of this.cliProvider.generateChatCompletion(cliMessages, cliTools)) {
|
83
|
-
const message = cliMessage;
|
84
|
-
let coreRole;
|
85
|
-
switch (message.role) {
|
86
|
-
case ContentGeneratorRole.USER:
|
87
|
-
coreRole = 'user';
|
88
|
-
break;
|
89
|
-
case ContentGeneratorRole.ASSISTANT:
|
90
|
-
coreRole = 'assistant';
|
91
|
-
break;
|
92
|
-
case ContentGeneratorRole.TOOL:
|
93
|
-
coreRole = 'tool';
|
94
|
-
break;
|
95
|
-
case 'system':
|
96
|
-
coreRole = 'system';
|
97
|
-
break;
|
98
|
-
default:
|
99
|
-
throw new Error(`Unknown role: ${message.role}`);
|
100
|
-
}
|
101
|
-
yield {
|
102
|
-
role: coreRole,
|
103
|
-
content: message.content || '',
|
104
|
-
tool_calls: message.tool_calls,
|
105
|
-
tool_call_id: message.tool_call_id,
|
106
|
-
parts: 'parts' in message
|
107
|
-
? message.parts
|
108
|
-
: undefined, // Preserve parts field for PDFs/images
|
109
|
-
};
|
110
|
-
}
|
111
|
-
}
|
112
|
-
}
|
113
|
-
//# sourceMappingURL=ProviderManagerAdapter.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ProviderManagerAdapter.js","sourceRoot":"","sources":["../../../src/providers/ProviderManagerAdapter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAElD;;GAEG;AACH,MAAM,OAAO,sBAAsB;IACb;IAApB,YAAoB,kBAAmC;QAAnC,uBAAkB,GAAlB,kBAAkB,CAAiB;IAAG,CAAC;IAE3D,iBAAiB;QACf,OAAO,IAAI,CAAC,kBAAkB,CAAC,iBAAiB,EAAE,CAAC;IACrD,CAAC;IAED,iBAAiB;QACf,MAAM,WAAW,GAAG,IAAI,CAAC,kBAAkB,CAAC,iBAAiB,EAAE,CAAC;QAChE,IAAI,CAAC,WAAW;YAAE,OAAO,IAAI,CAAC;QAE9B,OAAO,IAAI,eAAe,CAAC,WAAW,CAAC,CAAC;IAC1C,CAAC;IAED,qBAAqB;QACnB,OAAO,IAAI,CAAC,kBAAkB,CAAC,qBAAqB,EAAE,CAAC;IACzD,CAAC;CACF;AAED;;GAEG;AACH,MAAM,eAAe;IACC;IAApB,YAAo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 +0,0 @@
|
|
1
|
-
# Qwen3-Fireworks Provider Implementation
|
2
|
-
|
3
|
-
## Overview
|
4
|
-
|
5
|
-
The Qwen3-Fireworks provider enables the Gemini CLI to use the Qwen3-235B model through Fireworks AI's OpenAI-compatible API. This implementation addresses the specific needs of Qwen3, including handling its unique control tokens and ensuring smooth operation with tool calls.
|
6
|
-
|
7
|
-
## Key Features
|
8
|
-
|
9
|
-
1. **Automatic Token Cleaning**: Removes Qwen3-specific control tokens (`<|im_start|>`, `<|im_end|>`, `<|reserved_special_token_*|>`) from both input and output
|
10
|
-
2. **Model Lock**: Ensures the correct Qwen3 model is always used
|
11
|
-
3. **OpenAI Compatibility**: Leverages the existing OpenAI provider infrastructure
|
12
|
-
4. **Multiple API Key Sources**: Supports environment variables, saved keys, and fallback to OpenAI keys
|
13
|
-
|
14
|
-
## Implementation Details
|
15
|
-
|
16
|
-
### Provider Class: `Qwen3FireworksProvider`
|
17
|
-
|
18
|
-
Located at: `packages/cli/src/providers/openai/Qwen3FireworksProvider.ts`
|
19
|
-
|
20
|
-
Key methods:
|
21
|
-
|
22
|
-
- `cleanQwen3Content()`: Removes control tokens and normalizes whitespace
|
23
|
-
- `generateChatCompletion()`: Wraps the parent method to clean content
|
24
|
-
- `getModels()`: Returns the Qwen3-235B model configuration
|
25
|
-
- `setModel()`: Ensures only Qwen3 models can be set
|
26
|
-
|
27
|
-
### Registration
|
28
|
-
|
29
|
-
The provider is registered in `providerManagerInstance.ts` with the following priority for API keys:
|
30
|
-
|
31
|
-
1. Saved key for 'qwen3-fireworks'
|
32
|
-
2. `FIREWORKS_API_KEY` environment variable
|
33
|
-
3. OpenAI API key (as fallback)
|
34
|
-
|
35
|
-
## Usage
|
36
|
-
|
37
|
-
```bash
|
38
|
-
# Set API key
|
39
|
-
export FIREWORKS_API_KEY=your-api-key
|
40
|
-
|
41
|
-
# Or use in the CLI
|
42
|
-
/provider qwen3-fireworks
|
43
|
-
/key your-api-key
|
44
|
-
```
|
45
|
-
|
46
|
-
## Testing
|
47
|
-
|
48
|
-
Tests are included in `Qwen3FireworksProvider.test.ts` covering:
|
49
|
-
|
50
|
-
- Provider initialization
|
51
|
-
- Model listing
|
52
|
-
- Token cleaning functionality
|
53
|
-
- Model setting behavior
|
54
|
-
|
55
|
-
## Benefits
|
56
|
-
|
57
|
-
1. **Seamless Integration**: Works with existing tool calling infrastructure
|
58
|
-
2. **Clean Output**: No Qwen3 control tokens leak into user-visible content
|
59
|
-
3. **Reliable Tool Calling**: Handles the model's tendency to exit after tool calls
|
60
|
-
4. **Cost Effective**: Uses Fireworks AI's competitive pricing for the powerful 235B model
|
@@ -1,18 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license
|
3
|
-
* Copyright 2025 Vybestack LLC
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
5
|
-
*/
|
6
|
-
import { IMessage } from '../IMessage.js';
|
7
|
-
import { ServerGeminiStreamEvent } from '@vybestack/llxprt-code-core';
|
8
|
-
/**
|
9
|
-
* Interface for adapting provider-specific streams to Gemini event format
|
10
|
-
*/
|
11
|
-
export interface IStreamAdapter {
|
12
|
-
/**
|
13
|
-
* Adapts a provider's stream format to Gemini's event stream format
|
14
|
-
* @param providerStream The provider-specific stream of messages
|
15
|
-
* @returns An async iterator of Gemini events
|
16
|
-
*/
|
17
|
-
adaptStream(providerStream: AsyncIterableIterator<IMessage>): AsyncIterableIterator<ServerGeminiStreamEvent>;
|
18
|
-
}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"IStreamAdapter.js","sourceRoot":"","sources":["../../../../src/providers/adapters/IStreamAdapter.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
@@ -1,46 +0,0 @@
|
|
1
|
-
import { IProvider, IModel, ITool, IMessage } from '../IProvider.js';
|
2
|
-
import { ToolFormat } from '../../tools/IToolFormatter.js';
|
3
|
-
export declare class AnthropicProvider implements IProvider {
|
4
|
-
name: string;
|
5
|
-
private anthropic;
|
6
|
-
private toolFormatter;
|
7
|
-
toolFormat: ToolFormat;
|
8
|
-
private apiKey;
|
9
|
-
private baseURL?;
|
10
|
-
private currentModel;
|
11
|
-
private modelCache;
|
12
|
-
private readonly modelCacheTTL;
|
13
|
-
private readonly retryableErrorMessages;
|
14
|
-
private modelTokenPatterns;
|
15
|
-
constructor(apiKey: string, baseURL?: string);
|
16
|
-
getModels(): Promise<IModel[]>;
|
17
|
-
generateChatCompletion(messages: IMessage[], tools?: ITool[], _toolFormat?: string): AsyncIterableIterator<unknown>;
|
18
|
-
setApiKey(apiKey: string): void;
|
19
|
-
setBaseUrl(baseUrl?: string): void;
|
20
|
-
setModel(modelId: string): void;
|
21
|
-
getCurrentModel(): string;
|
22
|
-
/**
|
23
|
-
* Helper method to get the latest Claude 4 model ID for a given tier.
|
24
|
-
* This can be used when you want to ensure you're using the latest model.
|
25
|
-
* @param tier - The model tier: 'opus', 'sonnet', or 'haiku'
|
26
|
-
* @returns The latest model ID for that tier
|
27
|
-
*/
|
28
|
-
getLatestClaude4Model(tier?: 'opus' | 'sonnet' | 'haiku'): string;
|
29
|
-
/**
|
30
|
-
* Resolves a model ID that may contain "-latest" to the actual model ID.
|
31
|
-
* Caches the result to avoid frequent API calls.
|
32
|
-
*/
|
33
|
-
private resolveLatestModel;
|
34
|
-
private getMaxTokensForModel;
|
35
|
-
private getContextWindowForModel;
|
36
|
-
private isRetryableError;
|
37
|
-
/**
|
38
|
-
* Validates and potentially fixes the message history to ensure proper tool_use/tool_result pairing.
|
39
|
-
* This prevents the "tool_use ids were found without tool_result blocks" error after a failed request.
|
40
|
-
*/
|
41
|
-
private validateAndFixMessages;
|
42
|
-
/**
|
43
|
-
* Anthropic always requires payment (API key)
|
44
|
-
*/
|
45
|
-
isPaidMode(): boolean;
|
46
|
-
}
|